If you wished to have a script named /root/backup.sh run every day at
3am, your crontab entry would look like as follows. First, install
your cronjob by running the following command:
crontab -e
Append the following entry:
0 3 * * * /root/backup.sh
Save and close the file.
How do I use operators?
An operator allows you to specifying multiple values in a field. There
are three operators:
The asterisk (*) : This operator specifies all possible values for a field. For example, an asterisk in the hour time field would be
equivalent to every hour or an asterisk in the month field would be
equivalent to every month.
The comma (,) : This operator specifies a list of values, for example: “1,5,10,15,20, 25”.
The dash (-) : This operator specifies a range of values, for example: “5-15” days , which is equivalent to typing
“5,6,7,8,9,….,13,14,15” using the comma operator.
The separator (/) : This operator specifies a step value, for example: “0-23/” can be used in the hours field to specify command
execution every other hour. Steps are also permitted after an
asterisk, so if you want to say every two hours, just use */2.
*
Adding spaces and removing the extra
*
should work:More info - how-do I add jobs to cron under linux
Yes you can use a link to a file in crontabs - with the same conditions as always e.g.
cron
In fact, many common executable commands are symbolic links - even
/bin/sh
itself:So for example
results in