I have a script which reads files from a database, finds them in a directory and copies them to another directory as part of an upload system. The process is: 1. User uploads a file through ftp to /home/uploaduser 2. User enters info into a mysql database 3. A cronjob (download.php) polls the database, finds the uploaded file name 4. Same cronjob checks /home/uploaduser for the filename and copies the file to another directory
If I run download.php from the command line, the script works. If I run it from crontab, it fails to find the file with file_exists().
Here's the cronjob: */1 * * * * php /home/downloads/cron-scripts/download.php >/dev/null 2>&1
I've tried changing ownership of the files to the user who runs the cronjob, with no difference.
The cronjob is installed running: crontab -e as the user who also runs the script. The user who runs the script is in the uploaduser group, and the uploaduser group file permissions are 664.