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

Cron generated by Whenever doesn't work

It seems that my cron task doesn't work. Here is the result of "contrab -l" # Begin Whenever generated tasks for: /home/mtaville/mtaville_staging/releases/20140827132856/config/schedule.rb * * * * * /bin/bash -l -c 'cd…
p0k3
  • 333
  • 5
  • 23
0
votes
4 answers

Cannot get whenever to run my rake task

I am trying to get whenever to run my rake task but it doesn't work. #Command Line $ whenever -w [write] crontab file written #schedule.rb every :year, :at => "2014-07-25 17:39:48 -0700" do rake 'timeperiod:create_timeperiod' end The rake…
Eric Baldwin
  • 3,341
  • 10
  • 31
  • 71
0
votes
1 answer

Rails run object method on itself periodically

I need to run a method once daily in a Rails application. I'm thinking about using the whenever gem, but I realize I have a bit of a problem. I need to run the method on an instance of an object. So I can't just have something like: every 1.day do …
Hugo
  • 2,186
  • 8
  • 28
  • 44
0
votes
1 answer

Cron Job not working using whenever gem

I am trying to learn Cron Job and whenever gem. In my app i have created a rake task. require 'rubygems' namespace :cron_job do desc "To Check Users Inactivity" task user_inactivity: :environment do p "Inactive Users..." end end and in…
Nidhin S G
  • 1,685
  • 2
  • 15
  • 45
0
votes
4 answers

Not able to test cron job using whenever gem in rails 3

I did the following to implement cron jobs in rails 3 using a "runner" instead of a rake task. Step 1: I have whenever gem installed and scheduler.rb has following: set :environment, 'development' set :output, { :error => "/log/error.log", …
0
votes
1 answer

Schedule tasks to remove table entries

Can someone assist me setting up a cron job using the whenever gem? I want to clear the Notifications, Conversations, and Receipts tables every 90 days from the created_at dates. I'm not sure how to fill it in. every 90.day, :at => '4:30 am' do end
xps15z
  • 1,769
  • 1
  • 20
  • 38
0
votes
1 answer

Rails repopulate view after destroy. Whenever

I've setup a "Whenever" task that truncates a "news" table, refreshes my sitemap, then repopulates the news table. All at 5am everyday. (This gets rid of old news items and fetches new ones using nokogiri.) The problem is, every morning, i wake up…
mystic cola
  • 1,465
  • 1
  • 21
  • 39
0
votes
1 answer

Best way to manage gem whenever for sending emails

In my application there are posts which are going to expire in certain time of a day. After the expiration the customer needs to notify through emails. I have used Rails cron whenever for in each 1 minute and it makes expire the post at the…
Debadatt
  • 5,935
  • 4
  • 27
  • 40
0
votes
1 answer

Using Whenever with Rails 4 - Modify attributes from a model

I got a problem. I use whenever to run daily a method in a model class (of course). This method iterates over a collection of "holidays" instances and then notifies the existence of this holiday to a client (another model). Here comes the problem;…
0
votes
2 answers

Whenever + Mailer not are working together

I need to send some emails weekly. I installed the mailer and did several tests. Is working properly. But I can not use Whenever to automatically send emails. Have searched in various forums and still can not fix. Model/HrCurriculumIntern def…
0
votes
1 answer

Using whenever gem with sinatra

#config/scheduler.rb set :output, 'log/cron.log' every 1.minutes do rake 'reports:generate' end When I run crontab -l I get the following output: * * * * * /bin/bash -l -c 'cd bundle exec rake reports:generate --silent >>…
nicohvi
  • 2,270
  • 2
  • 28
  • 42
0
votes
0 answers

Getting error while running rake task in production

When I run $bundle env got the result as: Bundler 1.5.2 Ruby 2.1.0 (2013-12-25 patchlevel 0) [x86_64-linux] Rubygems 2.2.1 rvm 1.25.15 (stable) GEM_HOME /usr/local/rvm/gems/ruby-2.1.0 GEM_PATH…
Debadatt
  • 5,935
  • 4
  • 27
  • 40
0
votes
0 answers

Using Whenever with RedMine

I am trying to set up a cron task for a model in a redmine plugin. The Whenever gem looked like the best option. Alas, it does not seem to do anything. I have set up the gem, both in the config folder of the plugin and the primary one. I added it…
Btuman
  • 881
  • 2
  • 9
  • 37
0
votes
2 answers

Execute Rake task every fourth sunday using whenever gem

I have the following task defined in my schedule.rb that should be run every 1st of the month a 2am. every "0 2 1 * *" do rake ":task_1" end What I really want to do though is run that task every fourth sunday instead. All I found in the whenever…
Severin
  • 8,508
  • 14
  • 68
  • 117
0
votes
0 answers

Could not find table 'objects' (ActiveRecord::StatementInvalid)?

I encountered a problem when executing the scheduled job by whenever. In my config/schedule.rb: every 1.minutes do runner "Ubike.update" end The function works without errors in the console, but I got this error message in the…
David T.
  • 90
  • 1
  • 6