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
6
votes
4 answers

Ruby on rails scheduled tasks

This is my first time scheduling a task and I am not sure of the best implementation (or the proper implementation). My Goal: I have a ruby on rails 4 app setup with twilio and deployed on Heroku. I want the app to automatically text all of my…
stecd
  • 1,681
  • 6
  • 19
  • 28
6
votes
2 answers

Sidekiq processing with local redis but not with remote

I have a RoR app with background jobs using whenever and sidekiq gems. In development environment when I launch sidekiq with local redis instance (on localhost) the job keeps getting executed without problems. But when I switch to a remote redis…
Matic Jurglič
  • 831
  • 9
  • 26
6
votes
3 answers

Whenever - Cron not working? Permission denied

'I have set up a cron with wehenever, but its not working. I tried to run the command manually and i get the error /bin/bash: bin/rails: Permission denied. Here what the command of the cron looks like: /bin/bash -l -c 'cd /var/www/domain.net/main &&…
6
votes
2 answers

how to force rake task to run under development environment using Whenever gem

I'm using Whenever gem to run a rake task. When I run rake task it runs under development environment, but when it runs on a scheduled time it refers to a production environment. How can I force to run a scheduled rake task under development…
Askar
  • 5,784
  • 10
  • 53
  • 96
6
votes
2 answers

Undefined method with rails runner

I'm using the gem whenever and I can't get my runner instruction working. I'm getting this error: /Users/bl0b/.rvm/gems/ruby-1.9.3-p125/gems/railties-3.2.11/lib/rails/commands/runner.rb:53:in `eval': undefined method `run' for…
bl0b
  • 926
  • 3
  • 13
  • 30
6
votes
1 answer

Can the whenever gem preserve existing lines in a crontab file?

I am using: Ruby 1.9.2 whenever 0.7.2 capistrano 2.9.0 capistrano-ext 1.2.1 I am using whenever in conjunction with Capistrano on deploys to manage my crontab files. I noticed that it completely rewrites my crontab files each time. I'd like to be…
Wes Gamble
  • 777
  • 10
  • 29
5
votes
2 answers

Issue using whenever gem

I am trying to use whenever gem in my application but I am not able to run rake command in schedule.rb. Error which is throwing up is /bin/bash: rake: command not found I am also using bundler so all my gems are freezed into the application.
Nidhi
  • 340
  • 2
  • 10
5
votes
1 answer

rails, whenever and docker - cron tasks doesn't run

My crontasks from schedule.rb doesn't work on docker container, but crontab -l result already contains this lines: # Begin Whenever generated tasks for: /app/config/schedule.rb 45 19 * * * /bin/bash -l -c 'bundle exec rake stats:cleanup' 45 19 * *…
5
votes
1 answer

Help with the "Whenever" gem in Ruby for cron tasks

I have not used cron before, so I can't be sure that I did this right. The tasks I want to be automated don't seem to be running. I did these steps in the terminal: sudo gem install whenever change to the application directory wheneverize . (this…
Eric
  • 51
  • 1
  • 3
5
votes
1 answer

How to use whenever gem to run a task at 2 am AND 2 pm?

Currently I run this code: every 1.day, at: '2am' do rake 'data:load_direct_monitoring_statistics' end if @environment == 'production' every 1.day, at: '2pm' do rake 'data:load_direct_monitoring_statistics' end if @environment ==…
Luis Masuelli
  • 12,079
  • 10
  • 49
  • 87
5
votes
1 answer

How to check if whenever gem is working?

I've got the following configuration. I've installed whenever gem, created shedule.rb: # Learn more: http://github.com/javan/whenever every 6.hours do runner "Part.check_status_update" end In part.rb model I have corresponding method. A. How…
zmii
  • 4,123
  • 3
  • 40
  • 64
5
votes
1 answer

In Whenever gem, if we use every :month, does it mean the end of month or beginning?

When using the whenever gem we can set a monthly job like this : every :month do ... end Will this run the job at the end of the month or at the start of the month? I want to run it at the end.
THpubs
  • 7,804
  • 16
  • 68
  • 143
5
votes
3 answers

Crontab not working from whenever gem

My linux server is running a Rails 4 app with Nginx/unicorn. I am using the Whenever gem to schedule tasks. Everything was working normally until a couple of days ago when the cron jobs appear to have simply stopped running. This is in my…
emersonthis
  • 32,822
  • 59
  • 210
  • 375
5
votes
1 answer

rails whenver gem , running a command only if certain condition passes.

We are using whenever gem with rails on our project. I understand that we can schedule a command using whenever gem like this. every 1.day, :at => '6:00 am' do command "echo 'hello'" end but my problem is that i want to execute this command only…
Sahil Dhankhar
  • 3,596
  • 2
  • 31
  • 44
5
votes
1 answer

sidekiq+whenever+unicorn uninitialized constant ClassWorker production env

I use Rails 4, sidekiq 2.13.1, whenever, cron script run every 2 minutes. No errors during the first execute but all next get errors. I got this error only in production env. My worker locate in app/workers. I've included it by following string in…
BuDen
  • 927
  • 10
  • 15
1 2
3
33 34