Setting Up A Crontab

They have: 13 posts

Joined: May 1999

Hey folks! I was wondering if anyone could help me out with crontabs....it was explained to one once, but I totally forget how it's done.

What I want to do is run a script every hour, on the hour, but I'm not sure what sequence of numbers I should use in the crontab entry....any help would be gratefully appreciated Smiling

They have: 32 posts

Joined: Oct 2000

Create a file with the following in it:

0 * * * * /path/to/command

...save the file then type:

crontab /path/to/file/u/just/created

And you're set. Here's what the 0 and the following 4 stars represent.

field allowed values
----- --------------
minute 0-59
hour 0-23
day of month 1-31
month 1-12 (or names, see below)
day of week 0-7 (0 or 7 is Sun, or use names)

The above file I told you create will run the script every 0 minute of every hour, every day of the month, every month, every day of the week. Hence every hour on the hour it will run.

Greg

They have: 13 posts

Joined: May 1999

Thanks Man!!!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.