PDA

View Full Version : Cron job help



marcia
03-28-2005, 04:59 PM
I am having difficulty getting a cron job to run. I am hoping someone here can give me some advice. I am a novice.

I am working outside of /var/www/html so my structure is this....

/var/work/worker/tools/cron_5.php -q

The cron looks this way in the cron file.

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/work/worker/tools/cron_5.php

in cron_5.php, the path is defined as #!/usr/local/bin/php -q

The website that I need this on is not the root site, however, the cron is in the cron file of the root site. Is any of this correct? The cron job does not run.

thanks in advance.

torrin
03-28-2005, 07:13 PM
You might try running that at the command line to make sure there are no errors. For some strange reason, our cron is configured to not mail logs to the user that runs it. Since you're already using cron, I assume you're familiar with ssh, so I won't go into that. At the command line type . . .
/var/work/worker/tools/cron_5.php Does it work?

marcia
03-28-2005, 08:02 PM
thanks for replying! :)


It doesn't email me because I don't know how to set that up.
When I ran the command, I got this...no clue what any of it means.

[root][~]$ /var/work/worker/tools/cron_5.php
Usage: php [options] [-f] <file> [args...]
php [options] -r <code> [args...]
php [options] [-- args...]
-a Run interactively
-c <path>|<file> Look for php.ini file in this directory
-n No php.ini file will be used
-d foo[=bar] Define INI entry foo with value 'bar'
-e Generate extended information for debugger/profiler
-f <file> Parse <file>.
-h This help
-i PHP information
-l Syntax check only (lint)
-m Show compiled in modules
-r <code> Run PHP <code> without using script tags <?..?>
-s Display colour syntax highlighted source.
-v Version number
-w Display source with stripped comments and whitespace.
-z <file> Load Zend extension <file>.

args... Arguments passed to script. Use -- args when first argument
starts with - or script is read from stdin

torrin
03-29-2005, 07:39 AM
This is probably the same thing that happens when cron tries to run it. Try removing the -q from the first line in the script. Then try running it again.