Imaulle Posted December 29, 2010 Share Posted December 29, 2010 Hello, I have a php script that I'm trying to have run from a different server via cron 1 9 * * * /usr/bin/wget wget -o http://www.site1.com/update.php -o /dev/null The log in /var/log/cron is showing this as having been run: Dec 26 09:01:01 host crond[10392]: (root) CMD (/usr/bin/wget wget -o http://www.site1.com/update.php -o /dev/null) Dec 27 09:01:01 host crond[17001]: (root) CMD (/usr/bin/wget wget -o http://www.site1.com/update.php -o /dev/null) Dec 28 09:01:01 host crond[2331]: (root) CMD (/usr/bin/wget wget -o http://www.site1.com/update.php -o /dev/null) however it does not appear to run successful (or at least nothing gets updated) Here is the update.php <?php require_once('functions.php'); mysql_connect("localhost","username","password"); mysql_select_db("database"); $result = mysql_query("SELECT * FROM ServerList"); while($row = mysql_fetch_array($result)){ $server = new Whm; $server->init($row['HostName'],$row['UserName'],$row['PassHash']); $NewUsedSlots = count($server->listaccts()); mysql_query("UPDATE ServerList SET UsedSlots='$NewUsedSlots' WHERE HostName='{$row['HostName']}'"); } $CurrentTime = date("Y-m-d G:i"); mysql_query("UPDATE UpdateTime SET TimeUpdated='$CurrentTime'"); ?> update.php does in fact work correctly when I run it from my own personal browser.. what is going wrong? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/222912-php-script-issue-with-cron/ Share on other sites More sharing options...
trq Posted December 29, 2010 Share Posted December 29, 2010 Remove the second wget from your crontab line. Quote Link to comment https://forums.phpfreaks.com/topic/222912-php-script-issue-with-cron/#findComment-1152575 Share on other sites More sharing options...
Imaulle Posted December 29, 2010 Author Share Posted December 29, 2010 wooooooo, thanks! Quote Link to comment https://forums.phpfreaks.com/topic/222912-php-script-issue-with-cron/#findComment-1152584 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.