Jump to content

Running php from cron - working up to a point


franko75

Recommended Posts

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!

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.