Page 1 of 1

Cron

Posted: Tue Jul 03, 2012 8:38 am
by Kolin
hi 2 all. I have one problem - I use laptop as web-server, for development (Mint 13 Maya). Here is some cron: "* * * * * php /home/user/webServer/test.php". And it doesnt work. But if I use "php /home/user/webServer/test.php" in the Terminal, it works perfect. I test it throught ssh. So, why cron dont work?

Re: Cron

Posted: Tue Jul 03, 2012 9:05 am
by xenopeek
Moving it here, as I think the users knowledgeable about cron are here.

Does php produce some logfile? Else you may want to wrap this in a small shell script to ensure you output any stderr or stdout output. Partial example of that is here http://forums.linuxmint.com/viewtopic.p ... 16#p481766.

Re: Cron

Posted: Tue Jul 03, 2012 9:06 am
by AlbertP
In which file did you put that cron line?

Re: Cron

Posted: Tue Jul 03, 2012 9:19 am
by Kolin
AlbertP wrote:In which file did you put that cron line?
I use crontab -e

Re: Cron

Posted: Tue Jul 03, 2012 9:32 am
by Kolin
xenopeek wrote:Moving it here, as I think the users knowledgeable about cron are here.

Does php produce some logfile? Else you may want to wrap this in a small shell script to ensure you output any stderr or stdout output. Partial example of that is here http://forums.linuxmint.com/viewtopic.p ... 16#p481766.
No log files. Connect to database, insert into valuses

Re: Cron

Posted: Tue Jul 03, 2012 9:47 am
by AlbertP
By default it indeed may not save things in a log file, but Vincent posted an how-to to save all the output of the terminal command to a file. Then you can find the output - maybe including an error - in the file.

Re: Cron

Posted: Tue Jul 03, 2012 10:02 am
by Kolin
AlbertP wrote:By default it indeed may not save things in a log file, but Vincent posted an how-to to save all the output of the terminal command to a file. Then you can find the output - maybe including an error - in the file.
not errors - I run it manually, script works.

Re: Cron

Posted: Tue Jul 03, 2012 10:06 am
by AlbertP
But maybe it does display an error when cron tries to run it. That's what the how-to of Vincent is for.

Re: Cron

Posted: Tue Jul 03, 2012 10:53 am
by Kolin
thanks, it works