Setting up a Cron Job in Linux
How to Guide:Â Setting up a Cron Job in Linux
1. Enter the following command in the console
crontab -e
2. Adding the cron job. Edit the cron file. You cron job shall look like this
1 2 3 4 5 /path/to/command
eg
10 3 * * * /root/backup.sh
This will run the cron job at 3.10 am
* 1: Minute (0-59)
* 2: Hours (0-23)
* 3: Day (0-31)
* 4: Month (0-12 [12 == December])
* 5: Day of the week(0-7 [7 or 0 == sunday])
* /path/to/command - Script or command name to schedule
3. If you want to execute a php script instead of a shell command, your cron job shall look like this
1 2 3 4 5 /path/to/php/interpreter -q /path/to/command
eg.
10 3 * * * /usr/bin/php -q /var/www/html/cron.php
cufkewvq said,
August 22, 2007 @ 5:17 am
cufkewvq…
cufkewvq…
mdpagyil said,
August 22, 2007 @ 5:18 am
mdpagyil…
mdpagyil…
efllhrbg said,
August 22, 2007 @ 5:19 am
efllhrbg…
efllhrbg…
cdenvgdc said,
April 27, 2008 @ 11:56 am
cdenvgdc…
cdenvgdc…