This week's giveaway is in the JDBC forum.
We're giving away four copies of Java Database Connections & Transactions (e-book only) and have Marco Behler on-line!
See this thread for details.
Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Running Dependent Jobs in Unix  RSS feed

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,

I have a shell script that gets kicked off at 8:00 which runs a java program
This java program finishes its task around 8:40 (this is not a certain time can finish earlier or get delayed as well)

I have another shell script that has to be made run directly after the above shell script. This script also runs a java process.

Since i really dont have too much hands on experience in Unix so dont know how to run dependent jobs

Also ,

The first process again runs at 12:00 and finishes around 12:40 or something . After this as well i need to kick off my second process

Please Help

Thanks & Regards
Rishi Chopra.
 
Bartender
Posts: 20766
124
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The simplest way to do that is simply to create a new script that calls the other 2 scripts one after the other and make it be the cron job script.
 
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the second should just run if the first was successful (dependent), combine both with && (like in java):

If script1 fails script2 will not be called - assuming either outher circumstances terminating script1, or using the exitstatus in your java programs (System.exit (0) := no error, System.exit (i); // i != 0, i := an errorcode).
 
Rishi Chopra
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks All
 
If you settle for what they are giving you, you deserve what you get. Fight for this tiny ad!
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!