Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Cron ta not working

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have scheduled some batches in solaris server cron tab, which is my db server. The probem is, that sometimes the batch runs but sometimes the same batch does not picked by cron to run.

Can anybody tell me what can be the reason for this?

Thanks in Advance.
Namrta
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you can post a copy of the cronjob entry and some code, I'll be happy to help you out.
 
Namrta Pandey
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
command which I have fired to schedule the batch is :

5,10,15,20,25,30,35,40,45,50,55 * * * * /ActDeact/Cron/Shell_script/PreActDeact.sh
 
Namrta Pandey
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have scheduled my batch in cron via java code which is as follows:



But my cron is not picking up the process to execute. Scheduling of batch is done in the same way as mentioned in trial messages.

Also let me know if there is any way to capture the process in shell script also.

Thanks in Advance
Namrta.
 
Ranch Hand
Posts: 781
Netbeans IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What am I missing? Where is 'cron' involved in the Java code? Are you saying you are running the Java as the cron job via a script and that this then uses Runtime.exec() to invoke another script? What does the cron email show when the process does execute and those times when the cron job does not execute?

Note1 - your cron job will not execute on the hour since 0 is not in the set of times.
Note2 - your use of Runtime.exec() is flawed. You need to read the 4 sections of http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html and implement ALL the recommendations. Failure to do so will just cause you more grief.
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic