Cron

Forum rules
Before you post please read this

Cron

Postby Kolin on Tue Jul 03, 2012 8:38 am

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?
Kolin
Level 1
Level 1
 
Posts: 15
Joined: Sat Apr 28, 2012 2:39 am

Linux Mint is funded by ads and donations.
 

Re: Cron

Postby xenopeek on Tue Jul 03, 2012 9:05 am

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 viewtopic.php?f=90&t=83116#p481766.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 14511
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Cron

Postby AlbertP on Tue Jul 03, 2012 9:06 am

In which file did you put that cron line?
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6513
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: Cron

Postby Kolin on Tue Jul 03, 2012 9:19 am

AlbertP wrote:In which file did you put that cron line?

I use crontab -e
Kolin
Level 1
Level 1
 
Posts: 15
Joined: Sat Apr 28, 2012 2:39 am

Re: Cron

Postby Kolin on Tue Jul 03, 2012 9:32 am

Vincent Vermeulen 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 viewtopic.php?f=90&t=83116#p481766.

No log files. Connect to database, insert into valuses
Kolin
Level 1
Level 1
 
Posts: 15
Joined: Sat Apr 28, 2012 2:39 am

Re: Cron

Postby AlbertP on Tue Jul 03, 2012 9:47 am

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.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6513
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: Cron

Postby Kolin on Tue Jul 03, 2012 10:02 am

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.
Kolin
Level 1
Level 1
 
Posts: 15
Joined: Sat Apr 28, 2012 2:39 am

Re: Cron

Postby AlbertP on Tue Jul 03, 2012 10:06 am

But maybe it does display an error when cron tries to run it. That's what the how-to of Vincent is for.
Registered Linux User #528502
Image
Feel free to correct me if I'm trying to write in Spanish, French or German.
AlbertP
Level 16
Level 16
 
Posts: 6513
Joined: Sun Jan 30, 2011 12:38 pm
Location: The Netherlands

Re: Cron

Postby Kolin on Tue Jul 03, 2012 10:53 am

thanks, it works
Kolin
Level 1
Level 1
 
Posts: 15
Joined: Sat Apr 28, 2012 2:39 am

Linux Mint is funded by ads and donations.
 

Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest