| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi I am trying to run a cron job once a day but wget (which chat told me is the command type to use) is giving an error
This is the cron wget -q -o /dev/null www.windermerelodge.co.uk/send/send.php (I have amended the command in case any naughty peeps tried to execute it This is the result /bin/sh: /usr/bin/wget: Permission denied If I just use the www.windermerelodge.co.uk/send/send.php command in the address bar it executes fine Any ideas? John |
|
|||
|
I believe there are various methods to do this. I use root instead of a url:
php /home/username/public_html/send/send.php and have no problems. I actually have my db connection and cron files above root for further protection, so they can't be run from a browser. i.e: php /home/username/send/send.php
__________________
West Dorset Community |
|
|||
|
Hi John, I think you append :
>/dev/null 2>&1 to the end to stop emails http://www.adminschoice.com/docs/crontab.htm#Example so : php /home/username/send/send.php > /dev/null 2>&1
__________________
West Dorset Community Last edited by jon123; 02-05-2008 at 11:27 AM. |
|
|||
|
Thanks
I am familiar with the "/dev/null" bit what does the "2>&1" bit do? Cheers John Answering my own question > /dev/null pipes standard output to a black hole 2>&1 send error message to the same place 1 is standard output, 2 is error output So to have only errors sent (which is in fact what I want) I just use > /dev/null See a very useful article here for more detail - http://www.xaprb.com/blog/2006/06/06...vnull-21-mean/ Last edited by Pommie; 02-05-2008 at 11:33 AM. |
|
|||
|
Good article!
I actually want my emails, there has been a couple of instances where the cron jobs have stopped working. Something to do with a vps service stopping and not auto-restarting. Although this I understand has now been sorted, i still need to make sure that every day i get my 3 cron emails letting me know the scripts have been executed. I am glad they are just daily though, if i received an email every 15 minutes i think i would need to blackhole them.
__________________
West Dorset Community |
![]() |
| Thread Tools | |
| Display Modes | |
|
|