prevent multiple cron on same job.

35 views
Skip to first unread message

hari bhat

unread,
Nov 28, 2012, 1:58:16 PM11/28/12
to rufus...@googlegroups.com
Hi

I am using rufus scheduler to run the cron job every 45 minutes.
Now the job takes 30 minutes to complete.So no issue with this.
But if we change the scheduler to every 5 min. We are in trouble.
Because the same job runs every 5 min.It wont complete the first job itself.
So now how can we prevent same job running again.How to start next scheduler until first job completes?

Thanks

John Mettraux

unread,
Nov 28, 2012, 3:41:50 PM11/28/12
to rufus...@googlegroups.com
Hello,

maybe this can help:

https://github.com/jmettraux/rufus-scheduler#allow_overlapping--false

You could also have a look at

https://github.com/jmettraux/rufus-scheduler#blocking--true and
https://github.com/jmettraux/rufus-scheduler#mutex--%E2%80%98that_mutex%E2%80%99

but I don't think they're of any help.

Another way of doing this is to have a flag file set by the job when it
begins. If the [next] job finds the file already existing it should not
proceed. You have to make sure the flag file is removed once the first job
completes (success or not).


Best regards,

--
John Mettraux - http://lambda.io/jmettraux

Reply all
Reply to author
Forward
0 new messages