Hi
route
of course you can run it from cron,
first just configure the script to run it form Command line and if it works, then you put it in cron.
Scripts are usually written in shell BASH (or some other)
so
look at here on how to write scripts in shell.
Here is a quick example and google should give you a lot of examples on "bash scripting".