Sponsored Content
Full Discussion: Job dependent on other job
Top Forums Shell Programming and Scripting Job dependent on other job Post 302088142 by pankajkrmishra on Saturday 9th of September 2006 12:02:02 AM
Old 09-09-2006
Job dependent on other job

Hi All

I am trying to run one command ie grep but I want it should execute only after the completion of a shell script has finished.

eg

Following is my script :

java -mx64m $JAVA_OPTS -Dant.home=$ANT_HOME -classpath $_CLASSPATH org.apache.tools.ant.Main -verbose -buildfile /opt/bea/wls
61/config/dev05/batch_automation/MBPSBatch/scripts/build.xml > /opt/bea/wls61/config/dev05/batch_automation/MassTransfer/lo
gs/ant.log 2>&1 &

grep -i "BUILD FAILED" /opt/bea/wls61/config/dev05/batch_automation/MassTransfer/logs/ant.log 2>/dev/null
rcode=$? ############save the return code here if Failed found it would be 0
if [ $? -ne 0 ]
then
echo "No failed found run the script abc.sh"
. /opt/bea/wls61/config/dev05/batch_automation/MassTransfer/startMassTransfer.sh
else
echo "Failed encounter ..."
mailx -s "[`date`] Failure: Error in script" sdfgg@dgssg.com < /opt/bea/wls61/config/dev05/batch_automation/Mass
Transfer/logs/ant.log
echo "Error was encountered in your script" | mailx -s "ALERT!!" dsfhjkhdfsjh@dsfjhl.com
fi

Problem is even though no BUILD FAILED is encountered in ant.log still else part gets executed ie Failed encounter.

Please suggest some ways so that it works on the logic....... if build success ,should process if part , if failure should execute else part

Thanks

Pankaj
 

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

First Job

Just wondering what other people where doing for there first Unix role. Mine was working with a ISP helpdesk (Windows support though I helped all the Linux people out whenever I could with support) :p then that went bust (One.Net if anyone knew of it) then I scored my first UNIX role. Working... (8 Replies)
Discussion started by: woofie
8 Replies

2. UNIX for Dummies Questions & Answers

at job

How do I configure my solaris 8 machine to run a job using at scheduler, as a different user. my at job only run as a root user, but i want to configure users to run at job. I try to run a job to copy file like at "time" </copy_script but this only run, if I run as a root user. the file... (4 Replies)
Discussion started by: hassan2
4 Replies

3. Shell Programming and Scripting

killing unix job after the job process completes

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. ... (1 Reply)
Discussion started by: dtazv
1 Replies

4. Solaris

killing a unix job after the job process gets completed

Hi, Thanks in advance. i need to kill a unix background running job after that job process completes. i can kill a job by giving the following unix command kill -9 processid how to kill the job after the current process run gets completed ? Appreciate your valuable help. Thanks... (7 Replies)
Discussion started by: dtazv
7 Replies

5. AIX

AT job

I have a little difficulty with the "at command". I use it to run hourly for daytime reports. I use korn shell scripting. It runs normal at daytime, but when at night it dies. So I have to start up in the morning again. The script is fine to me. I was thinking to switch to cron job, but I have a... (1 Reply)
Discussion started by: anhcuty
1 Replies

6. UNIX for Dummies Questions & Answers

How to insert child job under a box job?

I have this box job and it contains only one job under it which is to load a file. I want to insert a "File Watcher", "Copy File" to it? Have no clue how to do that...any help plzzz... (4 Replies)
Discussion started by: xejatt
4 Replies

7. Shell Programming and Scripting

Script to Start a Job after finding the Old job completed

Hi Experts, I need a script advice to schedule 12 jobs ( SAS Codes execute back ground ). Algorithem: 1. Script checks first job. 2. Finds first job is done; invoke second job. 3. finds second job is done; invoke third job. .. Request you to please assist. (3 Replies)
Discussion started by: Jerald Nathan
3 Replies

8. Shell Programming and Scripting

autosys job configuration for job failure.

We need to configure autosys that when a job fails continously for 3 times, we need to call another job. Is this possible in Autosys, or can anyone advice on the alternative. (2 Replies)
Discussion started by: sangea
2 Replies

9. UNIX for Advanced & Expert Users

Autosys Job: Job did not start

I have submitted an autosys job and force start it. Autosys hit the job 4 times to restart but it did not start and finally I terminate the job. Any idea why the job did not start. Below is the code I executed. 1214 missun0ap /export/home/bzn97r/develop/dswi/jil$ sendevent -E FORCE_STARTJOB... (0 Replies)
Discussion started by: jnrohit2k
0 Replies
ant(1)							      General Commands Manual							    ant(1)

NAME
ant - a Java based make tool. SYNOPSIS
ant [OPTIONS] [TARGET [TARGET2 [TARGET3] ...]] DESCRIPTION
Like make ant is a tool by which projects can be build. But unlike it, ant is based on Java which means it will run on every platform for which a Java Virtual Machine is available. This makes it a great tool for building Java software. By default it takes information from build.xml which describes the targets. -help, -h print help on the command line options -projecthelp, -p print project help information -version print the version information -diagnostics print information that might be helpful to diagnose or report problems -quiet, -q be extra quiet -verbose, -v be extra verbose -debug, -d print debugging information -emacs, -e produce logging information without adornments -lib <path> specifies a path to search for jars and classes -logfile <file> use the given file to output log to -logger <classname> use the given class to perform logging -listener <classname> add an instance of the given class as a project listener -noinput do not allow interactive input -buildfile, -file, -f <file> use the given buildfile instead of the default build.xml file. This is the ant equivalent of Makefile -D<property>=<value> use value for the given property -keep-going, -k execute all targets that do not depend on failed target(s) -propertyfile <name> load all properties from file with -D properties taking precedence -inputhandler <class> the class which will handle input requests -find, -s <file> search for buildfile towards the root of the filesystem and use it -nice <number> A niceness value for the main thread: 1 (lowest) to 10 (highest); 5 is the default -nouserlib Run ant without using the jar files from ${user.home}/.ant/lib -noclasspath Run ant without using CLASSPATH -autoproxy Java 1.5+ : use the OS proxies -main <class> Override Ant's normal entry point SEE ALSO
make(1) mvn(1) AUTHOR
This manpage is written by Egon Willighagen <egonw@sci.kun.nl> Debian GNU/Linux Feb 2010 ant(1)
All times are GMT -4. The time now is 04:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy