Hi
I try to use the crontab. When I'm logged as root I enter "crontab -e" Then I past "*/15 8-18 * * 1-5 parse.sh 2>/dev/null 1>/dev/null" Then I exit and have the message : "crontab: installing new crontab"
When I'm logged as root I can execute normaly : "./parse.sh"
Where I am wrong ?
Thibaut
Thibaut thibaut@fuse.co.uk writes:
Then I past "*/15 8-18 * * 1-5 parse.sh 2>/dev/null 1>/dev/null"
For testing, you should NOT redirect stdout or stderr. That way, you can see what it's doing. After it's working correctly, *then* you can discard the output.
Then I exit and have the message : "crontab: installing new crontab"
Normal.
When I'm logged as root I can execute normaly : "./parse.sh"
Note that (1) you're not passing the same command line as the crontab, and (2) you're not in the same working directory as the crontab. You probably don't have the same $PATH either.
Where I am wrong ?
Likely, you need to make the crontab line something like this:
*/15 8-18 * * 1-5 /root/parse.sh
Note the explicit path. Also, parse.sh might need to do a "cd /root" so that it's in the directory it wants to be in.
On Jan 31, 2007, at 5:59 PM, DJ Delorie wrote:
Thibaut thibaut@fuse.co.uk writes:
Then I past "*/15 8-18 * * 1-5 parse.sh 2>/dev/null 1>/dev/null"
For testing, you should NOT redirect stdout or stderr. That way, you can see what it's doing. After it's working correctly, *then* you can discard the output.
Then I exit and have the message : "crontab: installing new crontab"
Normal.
When I'm logged as root I can execute normaly : "./parse.sh"
Note that (1) you're not passing the same command line as the crontab, and (2) you're not in the same working directory as the crontab. You probably don't have the same $PATH either.
Where I am wrong ?
Likely, you need to make the crontab line something like this:
*/15 8-18 * * 1-5 /root/parse.sh
Note the explicit path. Also, parse.sh might need to do a "cd /root" so that it's in the directory it wants to be in.
Thank you !
On Wed, 2007-01-31 at 17:53 +0000, Thibaut wrote:
Hi
I try to use the crontab. When I'm logged as root I enter "crontab -e" Then I past "*/15 8-18 * * 1-5 parse.sh 2>/dev/null 1>/dev/null" Then I exit and have the message : "crontab: installing new crontab"
When I'm logged as root I can execute normaly : "./parse.sh"
Where I am wrong ?
Try making that "/root/parse.sh >/dev/null 2>&1" and it'll probably be OK.
---------------------------------------------------------------------- - Rick Stevens, Senior Systems Engineer rstevens@vitalstream.com - - VitalStream, Inc. http://www.vitalstream.com - - - - To iterate is human, to recurse, divine. - ----------------------------------------------------------------------
El Miércoles, 31 de Enero de 2007 18:53, Thibaut escribió:
Hi
I try to use the crontab. When I'm logged as root I enter "crontab -e" Then I past "*/15 8-18 * * 1-5 parse.sh 2>/dev/null 1>/dev/null" Then I exit and have the message : "crontab: installing new crontab"
When I'm logged as root I can execute normaly : "./parse.sh"
Where I am wrong ?
Thibaut
You have to put the full PATH to parse.sh, that's to say, for instance, /root/parse.sh
By the way, it's not a good idea to redirect the output to /dev/null, if something didn't work you would not be able to notice it. All the best.