Scheduling a java program using another java program -
as part of automation want schedule java program after 12 hours using java program running. client machine windows. can't when first script start , once ends, has schedule second script should start after 12 hours. suggestions on how it?
i use java.util.timer.schedule(timertask task, long delay). task schedule can invoke second java program appropriately. example:
public void scheduletask() { timer timer = new timer(); timer.schedule(new timertask() { public void run() { try { runtime.getruntime().exec("java secondprog.class &"); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } } }, 12*1000*60*60); }
Comments
Post a Comment