Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Christo16

macrumors newbie
Original poster
Jan 4, 2005
9
0
New York, NY
Hello I have a mac os x server machine that I have setup a cron to run a php file using wget and cron doesn't seem to work. I have setup cron on other mac's before and they have all worked. Also I know wget works because I have tested it. Is there anything else I should try?
I do crontab -e and enter this:
Code:
"10 1 * * * /usr/bin/wget -q localhost/cron.php"
and I get
crontab: installing new crontab
chris:~ localhost$
So it seems to have been installed correctly. Any ideas?
 
"10 1 * * * /usr/bin/wget -q localhost/cron.php"

should be:

10 1 * * * /usr/bin/wget -q localhost/cron.php

i assume that you have the qoutes. if not, then try running manually first
 
You've got a relative path in there (localhost/cron.php) - always use the absolute path. When the cron job tries to run, its base directory may not be where you think it is. If it's your own cron (not root's), and you don't have write access to where it's starting, that could cause the issue.
 
You've got a relative path in there (localhost/cron.php) - always use the absolute path. When the cron job tries to run, its base directory may not be where you think it is. If it's your own cron (not root's), and you don't have write access to where it's starting, that could cause the issue.

the base dir by default is the user's $HOME (home directory). try this out:

10 1 * * * /usr/bin/wget -q "http://localhost/cron.php" > /tmp/wget.log 2>&1
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.