Cronjob not creating .zip files

saden

Verified User
Joined
Nov 20, 2013
Messages
7
I am currently having an issue with creating files on my server due a cronjob. I use Direct Admin on a Linux server. This is my cronjob line:

/usr/local/bin/php /home/USER/domains/MYDOMAIN.COM/public_html/system/generate.php
The script basicly does this:

Create a database record in table_1
Update a row in the database in table_2
Create a .zip file on the server.
When I run the script by myself it does all that. But once the cronjob runs the script it does everything except Step 3 (Create a .zip file on the server).

I'm running out of ideas, it has to be something with the cronjob because when I run the script myself it works perfect! Did I wrote the cronjob wrong? Do I need to add something to be able to write files on the server (something with cronjob permissions??).
 
Did you make sure in the script that the name of the zip file is fully qualified? Cron jobs are not guaranteed to run in any specific path or have the $PATH set properly to find any executables. Until you get the bugs worked out, make sure you aren't redirecting stdin and stdout on the cron job, so you will see if any errors occur, the system will send an email to the owner of the cron job.
 
Back
Top