views:

123

answers:

2

I'm trying to get some cron jobs going through Dreamost using their panel. I'm also using rake to execute these jobs

My rake files are located in

app/lib/tasks/example.rake

But I don't know what code to give the panel to execute them

+1  A: 

My recommendation would be to avoid trying to do that in the first place.

Editing cron jobs manually is a pain in the ass, and rails has some nice utilities to avoid it.

There's a railscast on using the wheneverize gem to prvent these problems.

http://asciicasts.com/episodes/164-cron-in-ruby

If you want these cron jobs to be automatically updated every time you deploy to dreamhost, just put it in as part of your Capistrano deploy.rb

If you're not using Capistrano, I strongly recommend you look into:

http://www.capify.org/index.php/Capistrano

EDIT

If you do want to take the DH cron route, the following should work

cd /full/path/to/your/project && rake example
Jamie Wong
You have some good suggestions, but the dreamhost panel is simple and that is the best way to add with dh because I heard that their bots kill long running processes
Sam
All the wheneverize gem does is simplify the creation of cron jobs. It literally modifies the crontab file. It's simply easier to maintain across multiple servers than having to manually edit cron files all over the place. Using wheneverize won't spawn a long running process
Jamie Wong
Yeah, your right. both process just edit the cron tab. I just setup wheneverize in literally 10 min and its great!
Sam
A: 

if you're using rake, you could put

rake whatevertask

in the command field

mportiz08
-1 irrelevance; the problem is with cron and dreamhost
Sam
my bad, i must've misunderstood where you said that the rake task executes the cron jobs, and the `rake whatever` is referring to what you would use in the control panel--nevermind
mportiz08