Crontab does not execute script within a script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Crontab does not execute script within a script
# 1  
Old 12-29-2012
Crontab does not execute script within a script

Hello All,

I have a crontab schedule and its executing a script that is calling another script and does not execute.

Crontab : ***** /test.sh

and in test.sh
/usr/local/file.sh

and in file.sh
webproxy -l 192.168.1.151

But when I run the script (test.sh) directly it works. But using crontab it does not work. I checked mail log and it says "command not found : webproxy"

Please suggest how to get this work from cron.

Regards
Shaan
# 2  
Old 12-29-2012
This question is so common its in our FAQ.

webproxy probably isn't in cron's PATH. cron has a far more minimal PATH than a user login does.

You can call the command with the full path, i.e. /absolute/path/to/commandname, or set a PATH including the needed directory yourself, or run . /etc/profile as the first line in your script to get PATH set for you more like a shell login does.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Crontab scheduler to execute script every 45 days

Can someone please help me on how to schedule script to run every 45 days in crontab ? Thanks, Prince (5 Replies)
Discussion started by: prince1987
5 Replies

2. Shell Programming and Scripting

Execute a script based on status of embedded script

Hi, I have 2 scripts, first.ksh and second.ksh and would like first.ksh to run based on response of 'Y/y' received for second.ksh but in my case it continues to execute 'rm /tmp/list' irrespective of response received, below are my scripts with further info, Hope I'm making sense :) Thanks! ... (1 Reply)
Discussion started by: mbak
1 Replies

3. Shell Programming and Scripting

Batch script to execute shell script in UNIX server

Hi team, My requirement is to transfer pdf files from windows machine to unix server and then from that unix server we should sftp to another server. I have completed the first part i.e From windows to using to unix server with the help of psftp.exe code: psftp user@host -pw password <... (1 Reply)
Discussion started by: bhupeshchavan
1 Replies

4. Red Hat

root crontab wont execute a script

Greetings/ I have a script listed in my roots crontab 07 9 * * * /opt/HLRSDATA_2010_OCT/HLRS_Scheduler_sp.sh > /opt/HLRSDATA_2010_OCT/logs/HLRTKJob.log This script contains the following #!/bin/bash echo HLRSData Scheduler cd /opt/HLRSDATA_2010_OCT /usr/bin/java -Xms32m -Xmx1024m -cp... (6 Replies)
Discussion started by: RedSpyder
6 Replies

5. Programming

CGI Perl script to execute bash script- unable to create folder

Hi I have a bash script which takes parameters sh /tmp/gdg.sh -b BASE-NAME -n 1 -s /source/data -p /dest/data/archive -m ARC gdg.sh will scan the /source/data and will move the contents to /dest/data/archive after passing through some filters. Its working superb from bash I have... (0 Replies)
Discussion started by: rakeshkumar
0 Replies

6. Shell Programming and Scripting

Dos batch script to execute unix shell script

Can anyone help me with a dos batch script to execute a shell script residing in an unix server. I am not able to use ssh. Thanks in advance (2 Replies)
Discussion started by: Shri123
2 Replies

7. Shell Programming and Scripting

execute script without displaying child script messages

Hi i have a script which is calling another script. But my child script is displaying some values. sample script. export LOG_File=/log $/Project/Scripts/emit.ksh mv inner_test.ksh /log/test.ksh echo 'Success' here emit.ksh is doing some processing .and echoing some values. what i... (2 Replies)
Discussion started by: kam786sim
2 Replies

8. Shell Programming and Scripting

Execute unix shell script to text file using the script

Hi all, I am beginner in UNIX...I want to use unix shell script to create text.file...I know how to use using by command...can anybody tell me for the script? Thanks i changed the threads title from "tex file" to "text file", because "tex" would probably be misunderstood as reference to... (4 Replies)
Discussion started by: mastercar
4 Replies

9. UNIX for Dummies Questions & Answers

Crontab works but does not execute script

Hi guys, my first post time here, so hello to everyone :) I've got a problem running one of my scripts at work. I can get crontab working on simple scripts (i.e. one that just outputs date to a temp file). but it won't correctly execute the script i want to use. My script is a PHP script. It... (6 Replies)
Discussion started by: renegadeice
6 Replies

10. UNIX for Dummies Questions & Answers

how to execute sh script in bash shell via crontab

hello. we are porting over from HPUX Shell to Linux. my default shell is bash so i can no longer schedule to execute a sh script in crontab. can anyone pls help me out? I searched the site but didnt find any details. thanks! (1 Reply)
Discussion started by: jigarlakhani
1 Replies
Login or Register to Ask a Question