How to allow job to wait?

785 views
Skip to first unread message

sandip m Phatangare

unread,
Jun 25, 2015, 11:31:23 AM6/25/15
to rundeck...@googlegroups.com
Hello Experts,
 
Could someone please suggest how to allow job to wait for some time? I have user cases where the job has to wait till all the input files are received. So I need to setup job in such a way that it should wait for all input files and then only it should be kick off. If we didn't received the files in mentioned time-frame (specific window) then job should notify me that the input files are not in for that day.
 
Thanks in advance.
 
 
Sandip

Scott Chapman

unread,
Jun 25, 2015, 11:53:34 AM6/25/15
to rundeck...@googlegroups.com
I have a similar requirement. I just have a cron job that runs a script every 10 minutes to look for the files, then takes appropriate action when files have arrived. That now includes initiating a specific RunDeck job to process the data. 

I believe you'll have to create a similar script and periodically run it (which you could probably do from RunDeck instead of cron if you wanted). If there's a more elegant solution, I'm not aware of it. 

Scott Chapman

sandip m Phatangare

unread,
Jun 25, 2015, 12:23:16 PM6/25/15
to rundeck...@googlegroups.com
OK, thank you.
I thought there may be an in-build option in the application itself which allows user to set it in such way. I will try the workaround as you mentioned, in the meantime if you come across some other solution please let me know.
 
Thanks
Sandip

Erix Molinie

unread,
Jul 26, 2015, 2:36:59 PM7/26/15
to rundeck-discuss, sandipmp...@gmail.com
Hi,

there are very good questions, one for waiting on events and the other based on times or dates. As a scheduler or job orchestrator first of all we are thinking of the glorious ancestor named "crond" and its "crontabs".
I've read a bit of the documentation and I've not been able to find information about the "timing" for a job, like "each wednesday" or "at 11:00pm" or more difficult "each first friday of the month that is not bank holliday".
Okay, I must admit the last one is very strong, but if we want to compare to other products, some of them have these functionalities.
I know Rundeck is young, but it looks like the "timing" of operation is not on the its genetic and I think not in its roadmap as well.
I think it will be missed by many.
It's still a very promising software
If we continue on the "conditional triggers" another thing I did not see in the documentation is how to "bypass" a "job" and "fork" to another one depending of the "returned code" of the last executed job.

Regards
Erix

Mathieu Chateau

unread,
Jul 26, 2015, 2:55:35 PM7/26/15
to rundeck...@googlegroups.com, sandipmp...@gmail.com
Hello,

You can do the "old school" way for the wait putting logic in a script:

maxtime=10
wait=1
count=0
while [ "$wait" == "1" ];do
        echo checking for files
        if [ -f /tmp/myfile ];then
                echo file found
                #put work here
                wait=0
        else
                echo file missing, retry number $count
                if [ $count -lt 10 ];then
                        count=$(($count + 1))
                        sleep 10
                else
                        echo too many retry, aborting
                        wait=0
                        exit 1
                fi

        fi
done

sleep time can be put as job argument, as file path & co

  


Cordialement,
Mathieu CHATEAU
http://www.lotp.fr

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rundeck-discuss/fd8f3b21-4e07-4f0a-8723-d45d1ac8b0d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Erix Molinie

unread,
Jul 27, 2015, 2:11:31 AM7/27/15
to rundeck-discuss, sandipmp...@gmail.com
Bonjour Mathieu, :-)

nice piece of script. But don't you think it would be nice to have this kind of feature inside Rundeck?
I hope Rundeck's team will include some of these features in their roadmap.

Cordialement
Erix Molinie



Le jeudi 25 juin 2015 17:31:23 UTC+2, sandip m Phatangare a écrit :

Mathieu Chateau

unread,
Jul 27, 2015, 2:22:42 AM7/27/15
to rundeck...@googlegroups.com, sandipmphatangare
yes, sure.
They are really active this sort of feature are hoped/expected. 
From my understand, rundeck was started to allow scenario not covered by classic scheduler on the market. 
That's explain why you can find really cool things that you don't have with them, and on the other hand why we are missing "standard" feature for a scheduler.

In the meantime, you can put logic in script like my example. Just to wait for native solution

just my 2cents

Cordialement,
Mathieu CHATEAU
http://www.lotp.fr

--
You received this message because you are subscribed to the Google Groups "rundeck-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rundeck-discu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages