Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [SOLVED] Only half my script runs Post 302738205 by vsekvsek on Friday 30th of November 2012 02:16:37 PM
Old 11-30-2012
[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.sh


Last edited by joeyg; 11-30-2012 at 03:19 PM.. Reason: Please wrap data and sripts with CodeTags
 

8 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

My script runs too slow :-(...

Hello experts, I have a series issue in script that result with bad peformence and I wonder if you can assist me. For example I have two files: File-New, size 15Mb. File-Old, size 1Mb. File-New content: a b c k File-Old content: d f a b (0 Replies)
Discussion started by: roybe
0 Replies

2. Shell Programming and Scripting

Shell Script: want to insert values in database when update script runs

Hi , I am new to linux and also also to shell scripting. I have one shell script which unpacks .tgz file and install software on machine. When this script runs I want to insert id,filename,description(which will be in readme file),log(which will be in log file) and name of unpacked folder... (1 Reply)
Discussion started by: ring
1 Replies

3. Shell Programming and Scripting

Shell script which runs sql script

Hi all, I need a shell script which runs a sql script but I couldn't find how to finish it. This is the code that I have: #! /usr/bin/ksh export SHELL=/bin/ksh export ORACLE_SID=database export ORACLE_HOME=/opt/oracle/product/9.2.0.8 sqlplus user <<EOF @/path/path/path/scriptname.sql... (3 Replies)
Discussion started by: Geller
3 Replies

4. Shell Programming and Scripting

How would you return how long a script runs for?

When running a ksh script, how would you time how long it took the script ran for? Is there a command that can capture this? (1 Reply)
Discussion started by: Jazmania
1 Replies

5. Shell Programming and Scripting

Script sortof half-working?

I have directories full of files that contain dates and times in their names in the format YYYYMMDDhhmm. So like, one of the files is named 199407271609 with no file extension. I have this script searches a given directory and changes all creation dates of the files to match the date in their... (4 Replies)
Discussion started by: hot_pants
4 Replies

6. UNIX for Dummies Questions & Answers

Script only runs as a particular user

Hi guys So I've got this PERL script that for one reason or another I need to run as a user other than the user that created the script. When I su - to another user the script won't run and doesn't give me any output as to why. No permission denied or anything like that. I've chmod 777'd the... (5 Replies)
Discussion started by: Jaymoney
5 Replies

7. UNIX for Dummies Questions & Answers

Alias script which runs with cronjob

Hi, I wrote a alias script and I want to run this script every day at 10 AM. I don't want to mention this alias command in .profile(Since alias commands are nearly 30 to use). so when I'm trying to call script with cronjob its not running, any help on this. the script looks like : ... (2 Replies)
Discussion started by: rockingvj
2 Replies

8. UNIX for Advanced & Expert Users

Script only runs first time through crontab

Hello, I am trying to run a script through crontab and it runs the first time and then it does not run. I tried to run a simple script (as shown below) and I see the same issue. #!/bin/ksh clear echo "Good Morning, World." > /tmp/test123 Crontab Entry: 30 09 * * *... (9 Replies)
Discussion started by: hasn318
9 Replies
escape(1)                                                       Mail Avenger 0.8.3                                                       escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 11:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy