Jump to content


Photo

Cron


  • Please log in to reply
2 replies to this topic

#1 SieRobin

SieRobin
  • Members
  • PipPipPip
  • Advanced Member
  • 212 posts
  • LocationNew Jersey

Posted 03 March 2006 - 02:23 PM

I know this probably doesn't belong in here, but everyone here has actually given me legit help so I figured I'd ask.

I'm trying to set up a cron job to run turns on my MMORPG Web Based website, but I'm not very familiar with cron, so what command do I need to run to do this?

#2 live_to_love

live_to_love
  • New Members
  • Pip
  • Newbie
  • 5 posts

Posted 10 October 2008 - 02:45 PM

Log on your server as the user you want to run the cronjob. The cronjob will run at intervals depending on how you set it up. See below.

at the command line use:
crontab -e

There edit your crontab using the following sintax:
A crontab file has five fields for specifying day , date and time  followed by the command to be run at that interval.
*    *  *  *    *  command to be executed and arguments
-    -    -    -    -
|    |    |    |    |
|    |    |    |    +----- day of week (0 - 6) (Sunday=0)
|    |    |    +------- month (1 - 12)
|    |    +--------- day of month (1 - 31)
|    +----------- hour (0 - 23)
+------------- min (0 - 59)

#3 xsist10

xsist10
  • Members
  • PipPipPip
  • Advanced Member
  • 114 posts

Posted 10 October 2008 - 02:47 PM

If you're going to run a PHP script from crontab please remember that your "command to be executed and arguments" should look like this

/usr/bin/php -f /full/path/to/phpfile.php

And remember to use absolute paths in your scheduled code.
SA PHP Archives - www.phparchives.za.org




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users