vixie-cron and the 7 meta specifications that most people dont know about
Although its in the man page, most people don't know that you can specify schedules using one of these meta specs :
@reboot : Run once after reboot.
@yearly : Run once a year, ie. "0 0 1 1 *".
@annually : Run once a year, ie. "0 0 1 1 *".
@monthly : Run once a month, ie. "0 0 1 * *".
@weekly : Run once a week, ie. "0 0 * * 0".
@daily : Run once a day, ie. "0 0 * * *".
@hourly : Run once an hour, ie. "0 * * * *".
So if one of those fits the requirements, use it. At the very least, you end up with better readability. And because users can set these on their own, it allows them to create jobs and services that come online on machine reboot. Without there being any need for them to get access to the system initscripts. Easy win for a problem that comes up quite a few times and in many places.
Now someone needs to make puppet be aware of these!
- KB
4 comments
With "0 * * * *" I know exactly when it is supposed to run!
I guess it's just a matter of preference :-)
----
@reboot : Run once, at startup.
----
I also tested this and the command doesn't seem to be executed on just a 'service crond restart'.
the @reboot: will run when the machine reboots/ boots. Not when cron restarts.
This post has 67 feedbacks awaiting moderation...
Comments are closed for this post.
28/Sep/2010 06:56:34 am,