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
0
votes
2 answers

How to make whenever skip files in progress

We're using the Ruby gem whenever to manage large batches of import jobs. But what if a file is still being imported when the next cron job occurs? For example: 12am: whenever starts an import cron job for import.csv 2am: import.csv is still being…
Allen Fuller
  • 97
  • 1
  • 10
0
votes
3 answers

How to specify rvm gemsets for Rails gem whenever?

MyApp is using rvm gemset 1.9.3@rails-3.2. It is not default. I am using gem 'whenever' to periodically send email notifications. This is my schedule.rb: every 1.minutes do runner "MyModel.send_emails" # if ... end Cron job is not working…
Mihail Davydenkov
  • 1,861
  • 2
  • 19
  • 33
0
votes
2 answers

whenever gem: when work starts for the first time?

In my schedule.rb file I have the following lines: every 6.day, :at => "9:00am" do runner "my_function" end When my function starts for the first time?
user1531875
  • 49
  • 2
  • 8
0
votes
1 answer

Add time-lag in whenever with capistrano between same role?

I want to add time-lag between same role. e.g. roles :app = [app1, app2, app3] My expectation(pseudo code): app1: "1 * * * * rake 'heavy:task'" app2: "3 * * * * rake 'heavy:task'" app3: "2 * * * * rake 'heavy:task'" 1,2,3 is not important, but…
Matt - sanemat
  • 5,418
  • 8
  • 37
  • 41
0
votes
1 answer

Loading variable from time to time in the controller with Whenever

I'm working on a project where i want to do a mysql query from time to time. The query is too long, and actually it's done when the user does a request. I'm afraid if many users does the request, the application will be too slow to respond. So, I…
Hugo Tamaki
  • 41
  • 1
  • 7
0
votes
1 answer

Database Time comparison for whenever gem cron job

I am writing a whenever runner defined in the Schedule model like this; def self.scheduled_jobs jobs = Schedule.where(execution_time <= Time.now ) if !jobs.nil? jobs.each do |job| task = Schedule.find(job) …
acacia
  • 1,375
  • 1
  • 14
  • 40
0
votes
0 answers

Getting Whenever to Work with RVM and Capistrano

I'm deploying an app that uses capistrano/whenever/rvm. Apparently, the whenever/rvm combo has a gotcha, as documented here. The wiki describes three ways of overcoming this. I've tried all of them and to no avail. These solutions include setting…
nullnullnull
  • 8,039
  • 12
  • 55
  • 107
0
votes
1 answer

Can I invoke rails runner from arbitrary directory?

I am writing some integration tests for a Rails application. The application has a set of background tasks which are normally scheduled via cron/whenever. Since the cron jobs only run every few hours, I want to run them directly from the…
Stefan
  • 8,819
  • 10
  • 42
  • 68
0
votes
1 answer

CRON task doesn't work on Amazon EC2

I prepared a simple task for testing CRON jobs on Amazon EC2: schedule.rb set :output, "/home/a/b/current/log/cron_log.log" every 5.minutes do #command "/usr/bin/some_great_command" #runner "MyModel.some_method" #rake…
user984621
  • 46,344
  • 73
  • 224
  • 412
0
votes
1 answer

Whenever CRON tab doesn't work on Amazon EC2

I am trying to set up CRON jobs on Amazon EC2 with using the Whenever gem. In the schedule.rb is following: set :output, "/home/my_deploy_name/my_deploy_name/current/log/cron_log.log" every 2.minutes do puts "It's working !!!" end and in the…
user984621
  • 46,344
  • 73
  • 224
  • 412
0
votes
1 answer

Capistrano + Whenever gem: Cannot deploy, "whenever is not part of the bundle. Add it to Gemfile. "

I ma trying to add Whenever gem to my Rails project, I added the gem to the Gemfile gem "whenever", "~> 0.8.4" and it was installed without any problems. Then I added a simple task into the generated schedule.rb file: set :output,…
user984621
  • 46,344
  • 73
  • 224
  • 412
0
votes
1 answer

Whenever running every 2 hours

I am currently facing some problem to make whenever running as I wish. For example now it is 2:45pm and I want to my task run every 2 hours from now. So it should run at 4:45pm , 6:45pm, 8:45pm, 10:45pm ... Thank for your help.
Sokmesa Khiev
  • 2,910
  • 3
  • 19
  • 30
0
votes
1 answer

Ruby on rails: Whenever/cronjob doesn't worked

I wrote a cronjob but it won't start working even though I updated my schedule.rb. I used javan/whenever. I am using: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.3.0] When I crontab -l: # Begin Whenever generated tasks for:…
shoujo_sm
  • 3,173
  • 4
  • 37
  • 60
0
votes
1 answer

Rails: Scheduled Job not Running

I'm using the Whenever gem with my Rails 3.2 app on an Ubuntu server. I have a monthly job that I want to run on the first day of the month, but it didn't seem to work. I know that the code works because I ran it from the console on the server…
yellowreign
  • 3,528
  • 8
  • 43
  • 80
0
votes
0 answers

Saving a new value to the db using the whenever gem

I'm trying to save a value in my db every hour. Let's say it saves a random string of characters to the letter field in my randomizer table. I have the whenever gem installed and my schedule.rb runs every hour calling a class method in my model. …
kruptos
  • 15
  • 5