|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | 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 !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
[SOLVED] Only half my script runs
Hello out there, I got this script that runs partly fine by my crontab. Problem is it gets to the sleep 300(which should be 5 minutes right?) part and never runs the rest of the scripts past that. All individual scripts run just fine. My var/mail file only shows it up to the " echo "Loader Stop complete." part and nothing after that. Do I need to break this out to a stop and then start script called seperately by the crontab or am I doing something wrong in this script here? Code:
#!/usr/bin/bash
. /export/home/ip/.profile
stop
echo "Webapp Stop complete."
. $HOME/bin/setEnvironmentVars.sh
$BIN_DIR/stopworkers.sh
echo "Workers Stop complete."
. $HOME/bin/setEnvironmentVars.sh
thisbranch=`$PRIVATE_DIR\/getBranchCode.sh`
DATA_DIR=/prod/app/$LOGNAME/data/
pid=`$PRIVATE_DIR/\checkLoaders.sh`
if [ "$pid" = '' ] ; then
echo "No IP Loader is running."
exit 0
fi
echo " Killing process " $pid
echo " Aborting IP Loader..."
kill -9 $pid
sleep 3
exit 1;
echo "Loader Stop complete."
sleep 300
echo "Re-Starting Workers and loader and webApp.. "
start
$BIN_DIR/startworkers.sh
$IPWORKER_HOME/bin/startLoader.shLast edited by joeyg; 11-30-2012 at 02:19 PM.. Reason: Please wrap data and sripts with CodeTags |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
Maybe it can't find sleep in its path, that's the kind of error you often get in cron, try /usr/bin/sleep instead (or whatever path it happens to have on your system)
|
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
I don't even know how it is printing Loader Stop complete.!! because I see an exit call right before this step and it is called without any condition check! Code:
kill -9 $pid sleep 3 exit 1; echo "Loader Stop complete." Can you please recheck this step? Last edited by Yoda; 11-30-2012 at 03:16 PM.. |
|
#4
|
|||
|
|||
|
your right I was reading it wrong. That seems to be my issue. thanks guys
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script sortof half-working? | hot_pants | Shell Programming and Scripting | 4 | 02-18-2009 12:32 PM |
| Shell Script: want to insert values in database when update script runs | ring | Shell Programming and Scripting | 1 | 10-25-2007 03:06 AM |
| My script runs too slow :-(... | roybe | UNIX for Advanced & Expert Users | 0 | 06-13-2005 12:54 PM |
|
|