![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Running shell scripts from web browser | corleone | Shell Programming and Scripting | 7 | 07-31-2006 11:11 PM |
| Running SQL Scripts from Shell script - Need insight! | manthasirisha | Shell Programming and Scripting | 6 | 07-03-2006 10:55 PM |
| unix shell scripts for running on solaris | srini_ibmadmin | UNIX for Advanced & Expert Users | 3 | 06-07-2006 03:28 AM |
| running vendor shell scripts | Javagate | UNIX for Dummies Questions & Answers | 1 | 04-13-2004 02:07 PM |
| Running shell scripts on a remote server | pepintheshort | UNIX for Dummies Questions & Answers | 2 | 07-22-2003 04:20 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
What are the rules of calling shell scripts in cron.
How do I go about setting up the correct PATHS that calls a script, which then calls another sub script all of which has to retain the orginal PATHS and VARS that I've set up in first script Confused.. ok Well Cron calls a script called script.cron - This script contains environment setups etc, and then calls another script script2.ksh I want the script2.ksh to retain all the environments etc that was set in script.cron |
|
||||
|
What you have should work. I have the same setup.
I kick off a script, say, first.sh which contains all the necessary paths, variables, etc and this first.sh script kicks off the next one which kicks off the next one, etc. crontab: 00 22 * * 1-5 ksh $HOME/bin/first.sh > $HOME/log/first.log 2>&1 This has been working for as long as I can remember and I think you are on the right track. first.sh scripts: PATH=$PATH:/usr/bin:/usr/local/bin:$SQLDIR/bin:$HOME/bin USERID=user01 PW=mypasswd LOGFILE=$HOME/log/logfile.log LIBPATH=...whatever etc . $HOME/bin/second.sh you get the idea. |
|
||||
|
I suppose you can use 'export' but my first.sh script doesn't have it and my 100 or so scripts that come after runs fine.
Also, isn't there a limit to how many processes you can chain together? After a certain amount of this type of call: . $HOME/bin/twenty.sh I have to do this: ksh $HOME/bin/twentyone.sh for recursive issues?? otherwise I get an error...Do you know why? Not sure of the exact count but to be safe I remember to use explicit calls intermittently after so many implicit calls. Don't go overboard with 'ksh' too though. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|