cronjobs
Format
Note: When creating crons, you will need to specify the FULL path to a command.
Eg. On the command-line you may type:
1 |
holland bk |
1 2 |
# echo $PATH /usr/local/sbin : /usr/local/bin : /sbin : /bin : /usr/sbin : /usr/bin : /root/bin |
Cron DOES NOT have this functionality. You will need to type the full path:
1 2 |
# which holland /usr/sbin/holland |
1 |
00 2 * * * /usr/sbin/holland -q bk |
Format
To view the format of crontabs you can read the file /etc/crontab
1 2 |
minute hour day month dayofweek command * * * * * |
1 2 3 4 5 6 7 8 |
* * * * * command to be executed - - - - - | | | | | | | | | +----- day of week (0 - 6) (Sunday=0) | | | +------- month (1 - 12) | | +--------- day of month (1 - 31) | +----------- hour (0 - 23) +------------- min (0 - 59) |
Viewing configured crontabs
You can use the following command to see the configured cronjobs on the server:
1 |
crontab -e |
Example Crontabs
1 2 3 |
min hour day month dayofweek [ command ] 30 0 1 1,6,12 * [0:30 Hrs on 1st of Jan, June & Dec] 10 4 1 * * [1st of every month @ 4:10] |
cronjobs.txt · Last modified: 2024/05/23 07:26 by 127.0.0.1