Questions tagged [whenever]

a Ruby gem that makes it possible to define cron tasks in Ruby

whenever is a Ruby gem that makes it possible to write and maintain cron tasks in Ruby, using a simplified and expressive syntax.

Resources

Related Tags

500 questions
53
votes
17 answers

Rails cron whenever, bundle: command not found

I am trying to use whenever to execute a rake task onces a day. Im getting this error /bin/bash: bundle: command not found /home/app/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find…
Josh Crowder
  • 1,041
  • 1
  • 10
  • 30
52
votes
4 answers

Sidekiq Rails 4.2 Use Active Job or Worker? What's the difference

This is my first processing jobs asynchronously I am implementing Sidekiq for background processing in my app. I will use it for reminder emails and in-app notifications. I am confused as to whether I should use Active Job to create a job that…
50
votes
5 answers

"Whenever" gem running cron jobs on Heroku

I created an app that uses the whenever gem. The gem creates cron jobs. I got it working locally but can't seem to get it working on heroku cedar. What's the command to do this? running: heroku run whenever --update-crontab job1 doesn't work
AdamT
  • 6,405
  • 10
  • 49
  • 75
44
votes
4 answers

Rails, using whenever gem in development

Sorry quick question here from a relative Rails newbie. I'm trying to use the Whenever gem to schedule a number of rake tasks. I can't for the life of me get it to actually begin running the cron jobs on my development machine. Judging from other…
user1377556
  • 565
  • 1
  • 5
  • 11
38
votes
10 answers

Rails cron with whenever, setting the environment

This question will probably only make sense if you know about the whenever gem for creating cron jobs. I have a task in my schedule.rb like every 1.day, :at => '4am' do command "cd #{RAILS_ROOT} && rake thinking_sphinx:stop…
Tony
  • 18,776
  • 31
  • 129
  • 193
24
votes
3 answers

Cron job not working in Whenever gem

I have an application that contains a bunch of tasks, and every day I want to run a cron job that creates a DayTask for each Task in the database. A Task has_many DayTasks and these daytasks are what users will be checking off every day. I'm using…
Grant David Bachman
  • 2,158
  • 3
  • 21
  • 32
20
votes
5 answers

How to detect Rails environment inside whenever

This question will probably only make sense if you know about the whenever gem for creating cron jobs. For my app, I want to use whenever in all the environments, including testing and development. My schedule.rb looks like this: set :output, { …
Marius Butuc
  • 17,781
  • 22
  • 77
  • 111
19
votes
4 answers

Rails whenever gem: each month on the 20th

I searched all over the internet for this, and the documentation isn't really talking about monthly jobs in specific. So I was hoping that someone here could tell me how to do this. I've installed the whenever gem and all I need to know is the right…
Tim Baas
  • 6,035
  • 5
  • 45
  • 72
18
votes
3 answers

Setting path for whenever in cron so it can find ruby

My ruby is in /usr/local/bin. whenever can't find it, and setting PATH at the top of my cron file doesn't work either, I think because whenever is running the command inside of a new bash instance. # this does not…
John Bachir
  • 22,495
  • 29
  • 154
  • 227
16
votes
3 answers

whenever gem and scheduling a job every n min starting at an offset

For staggering purposes I am trying to schedule jobs an a 2 minute offset that run every 5 mins. That is I want 1 job to run 1,6,11,16.. and the other one to run at 2,7,12,17... I couldn't find an example to do this. So I tried: every 5.minutes,…
HeretoLearn
  • 7,124
  • 6
  • 24
  • 22
16
votes
4 answers

How to create a daily job (cron-like) in Rails ActiveJob?

I'm aware of this thread: A cron job for rails: best practices?, but there's no mention of ActiveJob. My motivation to do it with ActiveJob is because it's built-in in Rails and here's an excerpt from its docs: "These jobs can be everything from…
luthfianto
  • 1,746
  • 3
  • 22
  • 37
15
votes
2 answers

How to stop cron jobs created by "whenever" gem

I'm using the "whenever" gem and got it working by doing: whenever --set environment=production --update-crontab theCronJob The interval I'm using is 2 minutes since I'm still trying to figure it out. However, now I get a You have mail message in…
AdamT
  • 6,405
  • 10
  • 49
  • 75
13
votes
2 answers

whenever gem have cronjob on only one machine?

We have a large deployment of around a dozen servers. We'd like to use the Whenever gem but I can't figure out a way to say which machine the cron jobs should go on! We only want these jobs to run on our server that does background jobs. Is there a…
phil
  • 4,668
  • 4
  • 33
  • 51
12
votes
2 answers

Setting a Whenever job at different hours every day

I'm trying to set a Whenever job that should be executed 2 times a day, exactly at 11am and 11pm. Is there any way to do it with only one block? I mean something like this: every :day, :at => ['11am','11pm'] do runner "Task" end
Gawyn
  • 1,156
  • 1
  • 10
  • 21
11
votes
2 answers

whenever gem is throwing "can't iterate from Time" error

I'm using whenever gem for crone job but when I run it : cd ~/my_project whenever I get error /home/tomi/.rvm/gems/ruby-2.0.0-rc1@my_projcet/bundler/gems/rails-d1904aff6f04/activesupport/lib/active_support/core_ext/range/include_range.rb:16:in…
equivalent8
  • 13,754
  • 8
  • 81
  • 109
1
2 3
33 34