Tizag.com Webmaster Tutorials - A collection of webmaster tutorials from HTML to PHP.

Sunday, October 26, 2008

Setting Cron Job

Open putty and log in to the server using user name and password

type crontab -l to see the list of cron jobs.

type which php to see the location of the installation of php location

type crontab -e to edit the cron job.
minute hour day month day-of-week command-line-to-execute

The acceptable values for each of the 6 fields are:

FieldRange of values
minute0-59
hour0-23
day1-31
month1-12
day-of-week0-7 (where both 0 and 7 mean Sun, 1 = Mon, 2 = Tue, etc)
command-line-to-executethe command to run along with the parameters to that command if any

So if I want my cron job to run every at 9:30 pm
we Write

39 21 * * 6 /usr/bin/php /home/www/htdocs/biraj/testbiraj.php

and press ESC :wq

/usr/bin/php /=="PHP LOCATION"

home/www/htdocs/biraj/testbiraj.php == "LOCATION OF THE EXECUTABLE FILE"

for more details refer http://www.thesitewizard.com/general/set-cron-job.shtml

No comments: