Jump to content

Archived

This topic is now archived and is closed to further replies.

SieRobin

Cron

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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

[code]/usr/bin/php -f /full/path/to/phpfile.php[/code]

And remember to use absolute paths in your scheduled code.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.