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
4
votes
1 answer

Whenever Scheduled Task in Heroku with Rails

I need to run a scheduled task in Heroku using whenever. My first cron job in Rails! :-) It works fine locally, but how do you make it work in Heroku? I tried this: heroku run whenever --update-crontab store but... [fail] Couldn't write crontab; try…
user3402629
  • 59
  • 2
  • 9
4
votes
1 answer

Whenever gem specify on which server to run each job

According to whenever documentation is possible to specify a set of whenever_roles (https://github.com/javan/whenever#capistrano-roles). Now I want to define a set of cronjobs in the schedule.rb and divide them based on their roles something like…
Pablo
  • 3,433
  • 7
  • 44
  • 62
4
votes
3 answers

Error in bundle when executing cron.job with Whenever

I have the following schedule.rb every 1.minute do runner "User.persist_things" end But looking at my log/cron.log file, the output is the…
felipeclopes
  • 4,010
  • 2
  • 25
  • 35
4
votes
2 answers

Can I use Rails Whenever gem without Capistrano?

I have a Rails app that I have hosted on Amazon's Elastic Beanstalk. I want to use the Whenever gem to schedule tasks, but both the Whenever gem documentation and the this Railscast mention integration with Capistrano. I'm not using Capistrano for…
yellowreign
  • 3,528
  • 8
  • 43
  • 80
4
votes
5 answers

Could not find rake 10.0.3 in any of the sources, when working with Whenever and Capistrano

I'm trying to use the gem Whenever with Capistrano over my Rails app on 3.2.8, working with RVM and a gemset for that Rails version. I'm getting the following error: Could not find rake-10.0.3 in any of the sources (Bundler::GemNotFound) This is the…
pablomarti
  • 2,087
  • 2
  • 22
  • 35
4
votes
5 answers

How can I prevent overlapping cron jobs with Rails?

I have a cron job setup to run a task every 5 minutes. But sometimes the task takes > 5 minutes to run, so another copy of that task is run concurrently by cron. Is there a way in whenever or cron to we can make it to wait for the other job to…
Pratik Khadloya
  • 12,509
  • 11
  • 81
  • 106
4
votes
1 answer

rake task running in cron can't find database table

I have created the cron job with whenever (https://github.com/javan/whenever): every 1.hours do rake "scrape" end The rake scrape task runs fine when I run it manually, but when cron runs I get: rake aborted! Could not find table 'beskeds' The…
khebbie
  • 2,490
  • 3
  • 31
  • 53
3
votes
3 answers

Rails whenever cron

Before you read this, understand that I am completely new to the idea of a cron so this is difficult for me. I bundle installed the gem whenever. then i ran wheneverize . no errors. the schedule.rb was created. I have a file called…
Kevin
  • 1,574
  • 4
  • 19
  • 45
3
votes
3 answers

Rails: whenever + delayed_job to optimize rake tasks?

I use whenever to call rake tasks throughout the day, but each task launches a new Rails environment. How can I run tasks throughout the day without relaunching Rails for each job? Here's what I came up with, would love to get some feedback on…
Marco
  • 4,345
  • 6
  • 43
  • 77
3
votes
4 answers

whenever PATH in crontab file for rails 3 ubuntu

I am using whenever gem with rails 3. On my production server (ubuntu) , the runner task does not run. I tried setting the :set job_template to get -l -i as mentioned in this github ticket. However that does not solve the problem. The problem on…
ami
  • 81
  • 1
  • 5
3
votes
1 answer

Sudo doesn't have access to shell commands when deploying with Capistrano

I'm deploying my Rails 3 app using capistrano. I have on user (deploy) who's been added to sudoers. This is the user I'm deploying with. When I log on to the server as deploy I have access to all of the gem commands I need .ie: bundle, whenever…
bodacious
  • 6,608
  • 9
  • 45
  • 74
3
votes
1 answer

Rails 5: Cron jobs using Whenever not running

I am trying to make a task run every hour using the Whenever gem. #check_price.rake namespace :check_price do desc "TODO" task check_now: :environment do price_sync = PriceSyncLibrary.new Product.all.each do |product| …
raghav_vc
  • 65
  • 7
3
votes
1 answer

Cron not working in Whenever gem

I'm trying to use a gem whenever on my rails application, it seems like its not working because I created a task in my model and defined a method that just prints out the time. whenever I try to run whenever -i it gives me the following error …
Dee-M
  • 932
  • 5
  • 21
  • 36
3
votes
2 answers

GemNotFound rake when using whenever in development

I'm getting this one error I don't understand (I'm fairly new to rails) when using the gem 'whenever' in development mode. What I did was update config/schedule.rb and run whenever --update-crontab --set environment='development' crontab -l…
bmo
  • 147
  • 1
  • 11
3
votes
2 answers

Rails Capistrano - Whenever Cron appends cron jobs for every Deployment

I am using: Ruby 1.9.3 whenever 0.9.4 Rails 3.2 and capistrano/whenever extension. Whenever the deployment happens, it adds entries to the crontab file after each deployment. Since 5 deployments, there are 40 entries in crontab -l, as…
Sid
  • 4,893
  • 14
  • 55
  • 110