Is there a good way to run a rake task from a crontab?
It seems like I’d need to put in my crontab:
“cd rails_dir; rake whatever”.
Which is kind of ugly. Is there some way to set a value in the rake
command line to eliminate the need for the explicit ‘cd’? Maybe
something involving the ability to set env variables on the command
line? Some env variable I could set that would tell rake what rails app
to run in, and allow the command to be executed without the working
directory actually being that dir?
Or maybe I should use script/runner instead? Any good easy way to get
script/runner to invoke a rake task?
Any advice from someone who’s accomplished this kind of thing before?