ruby on rails - Heroku scheduler weekly? -
how can heroku scheduler run weekly?
is possible, can see can schedule hourly, every 10 mins, or daily tasks no option weekly.
if not, other heroku add-ons might allow me run jobs (i.e. cron job) tasks on weekly bassis in production.
thanks!
update 2:
require 'date' task :weeklydelete if date.today.wday.zero? runner "event.clear_expired" runner "activity.clear_expired" end end update 2.5:
$heroku run bundle exec rake weeklydelete -a friendiosenew running `bundle exec rake weeklydelete` attached terminal... up, run.6194 rake aborted! undefined local variable or method `path' main:object /app/lib/tasks/weeklydelete.rake:2:in `block in <top (required)>' tasks: top => weeklydelete (see full trace running task --trace)
set daily job, , in job check if day of week sunday (or whichever day). if day, run job. if isn't day, nothing , exit.
edit: thinking more
require 'date' task :weeklydelete if date.today.wday.zero? runner "event.clear_expired" runner "activity.clear_expired" end end the logging file stuff wont work on heroku, , i'm not sure you're using time stuff, fear if scheduler runs not @ 3, stuff might not work.
Comments
Post a Comment