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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.