franko75 Posted September 1, 2010 Share Posted September 1, 2010 Hi there, I am struggling to try and work out what is going wrong with a cron job i have running daily which opens up an imap mailbox and extracts a rar file to a directory on the web server. The script works ok when run manually, and when it is running from cron, I can see that it opens up the mailbox and reads unread messages, however, there seems to be an issue with extracting the rar file when running from the cron. Permissions are set to 777 on the relevant folder where the rar is being extracted to, so I'm not sure what's going on. My cron line is as follows: 05 20 * * * nicky /usr/bin/php -q /u01/www/vhosts/www.mysite.co.uk/httpdocs/imap_get_rars.php >/dev/n ull I'm a bit of a linux newb so any pointers in the right direction (or how to catch errors in this situation) would be great! Quote Link to comment https://forums.phpfreaks.com/topic/212280-running-php-from-cron-working-up-to-a-point/ Share on other sites More sharing options...
JonnoTheDev Posted September 1, 2010 Share Posted September 1, 2010 If the script is running from the crontab then there is absolutely nothing wrong with your cron job. I suggest doing some debugging within your php script to see where the script is failing. Maybe get it to write to a log file after it performs each task or sends you an email when it is complete. Have you tested this from the command line? php /u01/www/vhosts/www.mysite.co.uk/httpdocs/imap_get_rars.php Quote Link to comment https://forums.phpfreaks.com/topic/212280-running-php-from-cron-working-up-to-a-point/#findComment-1106077 Share on other sites More sharing options...
franko75 Posted September 1, 2010 Author Share Posted September 1, 2010 Thanks Neil, that helped me track down the problem. Some relative paths in my php script which I've changed to absolute and all working now. Quote Link to comment https://forums.phpfreaks.com/topic/212280-running-php-from-cron-working-up-to-a-point/#findComment-1106165 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.