Easy crontab with @ parameter
Monday, May 26, 2008 at 9:56AM
Captain Rtfb in Tips and Tricks, crontab

Today I had a 'ah erbelnis' (german)! Every time when I had to edit my crontab I had to count the five stars: months, hours etc. But take a look at...

man 5 crontab

We can use the @-parameter at the crontab:
Instead of the first five fields, one of eight special strings may appear:

string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".


Isn't that easy? Especially the @reboot, now we even can initiate reboot commandsat user level!

Article originally appeared on dutchtechies (http://dutchtechies.com/).
See website for complete article licensing information.