Re: [capistrano] Cron job replacement

73 views
Skip to first unread message

Lee Hambley

unread,
Mar 1, 2013, 3:30:04 PM3/1/13
to capis...@googlegroups.com
Unless Capistrano is a key piece of what you are trying to do, you might be better off with a lower level tool: https://github.com/wacku/sshkit will more than likely be the backend for the next major release of Cap, and can be scripted in a more familiar way (read, you won't have to jump hoops to meet the existing Cap DSL) it's just plain Ruby. See the EXAMPLES.md file in the repository for a bunch of common use-cases.

Failing that, please post back, and someone will be happy to help you getting Cap baked in.



On 1 March 2013 21:24, Serdar Sahin <ser...@hebux.com> wrote:
Hi,

We have number of long running cron jobs and need to execute these jobs locally in the server, as our LB timeouts them. For other jobs we use HTTP based jobs and manage them in the jenkins.

Since we also want to manage these jobs in the Jenkins for debugging and management purposes and provide HA for these jobs, we would like to utilise capistrano's invoke command to choose one of the running servers and execute the command locally. 

Is there any easy way to choose one of the web servers and try to invoke command only in that server, and if that fails move to the second one, up until the hard limit we define. (e.g. after 5 servers it should fail)

Thanks in advance,



--
--
* You received this message because you are subscribed to the Google Groups "Capistrano" group.
* To post to this group, send email to capis...@googlegroups.com
* To unsubscribe from this group, send email to capistrano+...@googlegroups.com For more options, visit this group at http://groups.google.com/group/capistrano?hl=en
---
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Donovan Bray

unread,
Mar 1, 2013, 9:49:15 PM3/1/13
to capis...@googlegroups.com
I don't use cap/Jenkins for this but I do use it to do deploys. 

I prefer using resque or delayed_jobs for Ruby apps. I'm sure other languages have similar async frameworks. 

Serdar Sahin

unread,
Mar 4, 2013, 1:50:12 PM3/4/13
to capis...@googlegroups.com
Thanks guys. SSHKit looks very promising.

Though, since we do all of our deployments using capistrano and there is a function to execute a remote command, it is much easier for us to handle this in capistrano, as the IP list and all the other configuration already exist for this.

We ended up doing it with this task. It works for now, but it is a bit hacky. We add this into our deployment scripts.


This is the command to execute;

cap -f /path/to/Capfile production cron -s cmd="uptime"

We'll be looking more into the SSHKit to do more things. 

Thanks..
Reply all
Reply to author
Forward
0 new messages