Results 1 to 3 of 3
Hi All,
I need quick solution. Kindly help.
I have a simple script which prints something...and have some pattern substitution...using "sed"...etc.
When I'm running the script from prompt, I'm getting ...
- 06-14-2007 #1
shell script not giving same output from CRONTAB
Hi All,
I need quick solution. Kindly help.
I have a simple script which prints something...and have some pattern substitution...using "sed"...etc.
When I'm running the script from prompt, I'm getting valid output.
When I'm running the script from prompt and redirecting its output to a named output file at the same location, it is working fine, getting valid output in the Output file.
When running the script and using tee to create the same output file, it's also working fine.....ISn't this GREAT!!!! but not after reading the line below.
BUT, when I have put the same command inside the crontab file (crontab -l output is given below) and I have scheduled it to run after 5-5 mins....its not creating the OUTPUT file.... WHY??????????? Need your help.
5,10,15,20,25,30,35,40,45,50,55,59 * * * * /bin/bash ~Chunna/Jhola/Linux/regconf.sh > ~Chunna/Jhola/Linux/regconf.out
...
Kindly help at your earliest.
Thanks
/Arun S
- 06-15-2007 #2
Issue solved. I corrected one path...and therefore..crontab entry is also creating valid output file.
BIG Q?: If the path was not right in my script, then why I didn;t any error mesgs on Terminal output screen while running the script from $ prompt, whereh it executes a "SED" command (written inside my script) and didn't find a file (it is expecting to be there).
Thanks for viewing...and taking care.
Arun
- 06-15-2007 #3
Are you saying that you had the wrong path hardcoded into the script? If so, you definitely should have gotten an error.
If you instead simply said 'sed' inside the script, crontab entries often have a different PATH than you do as a regular user. As a result, it's suggested that you always use the full path when invoking anything from cron.DISTRO=Arch
Registered Linux User #388732


Reply With Quote
