Seems crontab is not executing script...
When I execute the script as root :
Code:
[root@asterback ~]# php ~/script 0,5,10,15,20,25,30,35,40,45,50,55 * * * * php ~/script #test connection The script consists of php echo statements... Any reason why I don't see output on my CLI ? |
Quote:
Not sure whether this will work or not. try using absolute path while writing entry in crontab, 0,5,10,15,20,25,30,35,40,45,50,55 * * * * /path/to/php /home/user/script > /tmp/script.out 2> /tmp/script.err #test connection Now if your script run fine you will see your console output in /tmp/script.out and if it doesn't you will find it in /tmp/script.err |
Thank you. This works.
Is it normal that the file /tmp/script.out is re-created every time ?! |
Thats your wish,
In case you want to keep the output of every run of the scirpt you can change the redirection ">" to ">>". In existing case it will create the new error and the log file everytime. |
All times are GMT -5. The time now is 04:54 AM. |