UnixServerAdmin

Server Administration & Management

How to use special string to save time in Cron

Instead of the first five fields, you can use any one of eight special strings. It will not just save your time but it will improve readability.

Special 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 * * * *”.

Run ntpdate every hour:

@hourly /path/to/ntpdate

Advertisements

December 18, 2012 - Posted by | Cron | , , ,

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: