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

Is Rails's "delayed_job" for cron task really?

delayed_job is at http://github.com/collectiveidea/delayed_job Can delayed_job have the ability to do cron task? Such as running a script every night at 1am. Or run a script every 1 hour. If not, what are the suitable gems that can do that? And…
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
10
votes
2 answers

Capistrano 3 Sudo Password Hangs

I have the following capistrano 3 task: desc 'Add root scheduled tasks' task :root_schedules do on roles(:all) do within release_path do execute :sudo, :bundle, 'exec whenever -w config/root_schedule.rb -u root' end end end I…
zquintana
  • 371
  • 2
  • 5
  • 13
10
votes
6 answers

How to correctly implement recurring tasks with time/frequency set by user

Users subscribe to emails containing the last videos, but they also set when to get those emails. Subscription(user_id, frequency, day, time, time_zone) user_id | frequency | day | time | time_zone 1 | daily | null | …
CodeOverload
  • 47,274
  • 54
  • 131
  • 219
9
votes
3 answers

whenever gem schedule.rb file: doesn't recognize RAILS_ROOT variable

In schedule.rb file, the statement: require "#{RAILS_ROOT}/config/environment.rb" every "10 10 2 * * *" do command "mysqldump -u #{@db_username} -p#{@db_password} --single-transaction #{@db_name} > #{@backup_Path}/#{@db_name}.sql 2>…
sudhir
  • 320
  • 1
  • 5
  • 13
9
votes
1 answer

scheduling sequential tasks with whenever gem

i'm using whenever to schedule tasks for a rails application. I have a task like: every 24.hours do command "do_this" rake "do_that" end my point is, when i write it to my crontab, with whenever -w, i see that it generates two independent…
VP.
  • 5,122
  • 6
  • 46
  • 71
8
votes
5 answers

Rails 3 - Whenever gem error: /usr/bin/env: ruby: No such file or directory

When using the 'whenever gem', I get an error in the log: /usr/bin/env: ruby: No such file or directory It works when I run the job manually. I've installed everything with RVM. I've used the which command to find where my Ruby installation is, and…
Kevin
  • 91
  • 1
  • 2
  • 6
8
votes
5 answers

Bundler Error - Cannot Find rake-13.0.1 even though it is installed

I have a Rails import job that run as a cron job setup through the whenever gem. It was running correctly until I recently updated the app. Now we are seeing the following Error in the logs when the cron job tries to run. If I run the task manually…
Tracy McCormick
  • 401
  • 1
  • 7
  • 18
8
votes
4 answers

Rails - Whenever gem - Dynamic values

Lets say I have a cronjob like this: every 1.day, :at => '4:30 am' do runner "MyModel.task_to_run_at_four_thirty_in_the_morning" end Although, I would like to make '1.day' more dynamic, such as changing the value via a form in an…
Frexuz
  • 4,732
  • 2
  • 37
  • 54
8
votes
2 answers

Cron jobs using Whenever with VM, Docker & Dokku

I have a Ruby on Rails app in a Docker container on Ubuntu 14.04. I set up my deployments using Dokku but I'm unsure how to get my cron jobs working correctly. Currently I'm using the whenever gem which allows me to do something simple like: every…
Anthony
  • 15,435
  • 4
  • 39
  • 69
8
votes
2 answers

Mountable engine with cron (whenever gem)

Is it possible to use cron (via the whenever gem) to run tasks directly on mountable engine models. The cron I think would not be able to start from the main app since mountable engines are supposed to be isolated. I am able to use whenever within a…
pieterk
  • 305
  • 2
  • 17
7
votes
1 answer

rails + sideqik... How to perform a task at a specific date and time

I am using https://github.com/mperham/sidekiq gem in a rails app to schedule tasks at a specific date and time.. Ex: Send appointment reminder 10minutes before the appointment schedule time. class TextWorker include Sidekiq::Worker def…
magnetic
  • 91
  • 1
  • 5
7
votes
1 answer

whenever gem: I set :output but the logfile doesn't show up where I'd expect it to

In my schedule.rb file I have the following lines: set :output, '/log/cron_log.log' every 5.minutes do command 'echo "hello"' end I ran whenever -w as suggested in this question Rails, using whenever gem in development, and I assume the cronfile…
AJcodez
  • 31,780
  • 20
  • 84
  • 118
7
votes
2 answers

whenever gem: hourly tasks with minute set

I have a bunch of cronjobs managed by whenever. Everything works fine, but I have a few hourly cronjobs that are all triggered at the same time, so I'd like to stagger them. Worst case scenario I'm able to update the crontab manually, but I'd…
Daniel Tsadok
  • 573
  • 5
  • 10
6
votes
1 answer

How to run sidekiq in a separate different docker container apart from application

How to run sidekiq in a separate different docker container apart from application. We are using whenever for the sidekiq jobs, but the jobs are getting triggered in all web containers How do we setup the web container (rails app) and the sidekiq…
Rpj
  • 5,348
  • 16
  • 62
  • 122
6
votes
3 answers

Whenever gem 'failed to load command: rake'

looking for some help. I am running a rails app (v3.2.5) with the whenever gem (v0.9.7) and rake (v11.2.2). I am also doing this in a docker container image ruby:2.3 (cron was installed and bundle install was ran) Here is my schedule.rb set…
Awatatah
  • 455
  • 1
  • 5
  • 19
1
2
3
33 34