How to set up Cron manually?

Optimizing and customizing your VPS/Dedicated server

How to set up Cron manually?

Postby Mark » Fri Dec 25, 2009 10:49 am

Type crontab -e as the user that you want the Cron Job to be executed as.
The format of the job is like this. I'm gonna use some varibles, you should remember
those from algebra, for those of you that don't it is a letter that represents another
value (usually a number).

a b c d e f

where...
a = The minute after the hour that you want it done
b = The hour you want it done (Military Time)
c = Day of the Month
d = Month of the Year
e = Day of the week
f = 'command'

Code: Select all
5 0 * * * /usr/local/bin/email


Like the above example, /usr/local/bin/email, will run every night at 12:05 AM.
The * means to run every instance of the value in the field. Like a asterisk in the day field means to run everyday

Other Useful crontab commands
crontab -e opens the editor
crontab -l lists the contents of the crontab
crontab -r removes the crontab
Mark
 
Posts: 124
Joined: Fri Dec 11, 2009 2:18 pm

Return to Configuring VPS/Dedicated servers

Who is online

Users browsing this forum: No registered users and 1 guest

cron