cron
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
cron [2012/02/08 13:38] – created k2patel | cron [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 4: | Line 4: | ||
==== Special Usage ==== | ==== Special Usage ==== | ||
+ | Following Special words replaces common conventional usage | ||
+ | |||
<code bash> | <code bash> | ||
@reboot | @reboot | ||
Line 14: | Line 16: | ||
@hourly | @hourly | ||
</ | </ | ||
+ | |||
+ | Following variables you can define in cron as standard environment. | ||
+ | <code bash> | ||
+ | SHELL=/ | ||
+ | PATH=/ | ||
+ | MAILTO=root | ||
+ | HOME=/ | ||
+ | </ | ||
+ | |||
+ | ==== Usage ==== | ||
+ | Most common Usage terms defined as below. | ||
+ | < | ||
+ | <code bash> | ||
+ | # Minute | ||
+ | # (0-59) | ||
+ | 0 2 12 | ||
+ | </ | ||
+ | |||
+ | Also most of the time you might want to disable logging the output of commands or scripts you are running.\\ | ||
+ | Which can be used as follow. | ||
+ | |||
+ | <code bash> | ||
+ | 0 3 * * * bin/ | ||
+ | </ | ||
+ | |||
+ | Also some time you want to store output to file. it use standard notation for redirect.\\ | ||
+ | For Append **>> | ||
+ | For Overwrite **>** | ||
+ | |||
+ | <code bash> | ||
+ | 35 0 * * * /bin/bash / | ||
+ | </ | ||
+ | |||
+ | ==== Things need to know ==== | ||
+ | |||
+ | | ||
+ | * If the users account has a crontab but no useable shell in /etc/passwd then the cronjob will not run. You will have to give the account a shell for the crontab to run. | ||
+ | * If your cronjobs are not running check if the cron deamon is running. Then remember to check / | ||
+ | * | ||
+ | * Cron does not deal with seconds so you can't have cronjob' | ||
+ | * You can not use % in the command area. They will need to be escaped and if used with a command like the date command you can put it in backticks. Ex. `date +\%Y-\%m-\%d` | ||
+ | |||
+ | [[ http:// |
cron.1328708338.txt.gz · Last modified: 2020/08/10 02:29 (external edit)