Author |
Message |
jeff33190
Joined: 22 Aug 2007 Posts: 96
|
|
Start Job at Specific Time or Using Trigger File |
|
I would like to create a job that runs at a specific time each day (5am) for example. In addition, I would like for the same job to run anytime a specified trigger file is present. Can you point me in the right direction for how to create this logic? I can see how to do it using 2 different jobs, but I would like to just have one job.
Thanks,
Jeff
|
|
Tue Jan 26, 2010 5:08 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
I suggest to create a regular daily job scheduled to start each day at 5 am, Let's call it a "main" job. And then create a second "helper" job with a file-trigger schedule and invoking the "main" job in case this job is triggered. For example, it can use "Run Another Job" notification action for that purpose and do nothing else. To make it do nothing, choose script type for the job type and enter some comments like // this job is triggering another job
|
|
Tue Jan 26, 2010 6:40 pm |
|
 |
jeff33190
Joined: 22 Aug 2007 Posts: 96
|
|
|
|
Thanks, I wanted to make sure I wasn't overlooking an easy way to do it with one job. However, sounds like a second job is the best solution.
Jeff
|
|
Wed Jan 27, 2010 10:26 am |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
How about if I have 5 jobs which wait for a file ABC.dat starting at 5pm daily. Only once they see the ABC.dat, they start their normal process. Should I then create 5 more extra jobs? (one for each?)
Or can I just create one job, say, 'Start_job' which will kick off at 5pm and make the other 5 jobs dependent on it. In which case the 5 jobs will have to wait for 2 semaphore files: the ABC.dat and the Start_job trigger file. The problem I see here is that I want to have file action: 'Do not delete, rename or move semaphore file' for ABC.dat and 'Delete semaphore file after run' for Start_job trigger file.. which is not possible.
Please suggest the best alternative..
|
|
Sat Feb 27, 2010 11:55 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
 |
 |
Or can I just create one job, say, 'Start_job' which will kick off at 5pm and make the other 5 jobs dependent on it. In which case the 5 jobs will have to wait for 2 semaphore files: the ABC.dat and the Start_job trigger file. The problem I see here is that I want to have file action: 'Do not delete, rename or move semaphore file' for ABC.dat and 'Delete semaphore file after run' for Start_job trigger file.. which is not possible. |
Why not simple choose "move" action? This will free 'Start_job' from picking the same file again. Your other 5 jobs can then use the moved file. Will that work for you?
You can also make 'Start job' to programmatically kick other jobs, using JavaScript and Scheduler.runJob or Scheduler.queueJob functions. Or kick other processes, using Process.run or Process.runAndWait.
|
|
Sat Feb 27, 2010 12:48 pm |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
Thanks for the quick response.. I am not sure what 'move' does. I tried to read the 'Help' but not much was discussed about it.
|
|
Sun Feb 28, 2010 8:56 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Hmm... sorry, I thought it was kind of obvious (to me) and didn't spell out the complete action name. Please see the attached image

|
|
Sun Feb 28, 2010 10:58 am |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
No, you're clear. I know where to make that setting, I just don't get what it does. I mean where does it 'move' the semaphore file and how does it help? It does not prompt me for the new location. Sorry, please bear with me.. but can't grasp the concept ..
|
|
Sun Feb 28, 2010 2:05 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Click the Options button next to the drop-down list of choices for file operations.
|
|
Sun Feb 28, 2010 6:17 pm |
|
 |
laiko
Joined: 11 Feb 2010 Posts: 43 Country: India |
|
|
|
My bad.. Thank you..
|
|
Mon Mar 01, 2010 7:15 am |
|
 |
|