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
1
vote
1 answer

Whenever gem not working for every 1.day tasks but working for other arguments in rails

I am using whenever gem and I have written a rake task to send emails. In my schedule.rb when I use this code set :environment, "development" set :output, {:error => "log/cron_error_log.log", :standard =>"log/cron_log.log"} every :day, :at =>…
Nikhil Gopinath
  • 170
  • 1
  • 12
1
vote
2 answers

Where to put Ruby scripts for script/runner on a Rails project?

I have seen examples where it is put in the lib folder, and another example in the app folder. Is there standard place where it should be put for Rails 2.3.8 and Rails 3 convention?
nonopolarity
  • 146,324
  • 131
  • 460
  • 740
1
vote
1 answer

Command works on bash but not on cron

I am running a docker image (with cron already installed) with rails. Everything is running fine, except I'm trying to add a cron job which works as a command, but is giving me an error when adding to crontab. The following command is: 0,2 * * * *…
brunoban
  • 177
  • 3
  • 12
1
vote
1 answer

whenever gem not automatically running?

I have three tasks. Each one works upon using heroku run rake challenges:"name of rake" --trace Running rake challenges:challenge_accomplished --trace on livetochallenge... up, run.3478 ** Invoke challenges:challenge_accomplished (first_time) **…
AnthonyGalli.com
  • 2,796
  • 5
  • 31
  • 80
1
vote
1 answer

Setting env variable to a cron scheduled task using whenever gem

In my code below, I wanted to set few environment variables stored in a file. Am I missing something? Printing env in production after 'bundle exec whenever' does not show the environment variables set. Using whenever gem for a scheduled cron task…
1
vote
1 answer

Mina's Whenever integration. How do you set the "whenever_name"?

According to this file it looks like I should be able to set the "whenever_name" to create a custom namespace for my cron jobs. I read mina's documentation on whenever as found here. It does not mention how to set a custom namespace aka…
Jared Menard
  • 2,654
  • 1
  • 21
  • 22
1
vote
1 answer

Machine goes hang while running cron job with 1 minutes duration

I am new to Rails, I am using whenever to gem to run cron job.In my application, I have some jobs that can be performed by drivers.The jobs has start and end time and it can be assigned to drivers.By cron job I need to check some conditions, like a…
Avijit Majhi
  • 508
  • 9
  • 15
1
vote
1 answer

Setting dynamic environment for whenever scheduler

I need to set the environment for my whenever scheduler to all environment (production, staging & development) I need this because I want the cron to trigger on any given environment. I know I can set the environment as follow: set :environment,…
x6iae
  • 4,074
  • 3
  • 29
  • 50
1
vote
0 answers

Is it possible to access Models in schedule.rb (whenever gem)?

I am performing some tests in a Ruby on Rails application using Whenever gem. Is it possible to access Models from the schedule.rb file ?! For example: #Hard Worker job = Job.find_by(name: 'Hard') if job.status == 'active' every 4.minutes do …
Stefan Ciprian Hotoleanu
  • 2,202
  • 1
  • 23
  • 30
1
vote
1 answer

Rails migrate cronjobs to whenever

On server we have the following cronfile: MAILTO=admin_email@project.com * * * * * /bin/bash -l -c 'cd /path/to/project/folder;RAILS_ENV=production bundle exec rake some_rake_task' 0 */2 * * * /bin/bash -l -c 'cd…
Andrey Deineko
  • 51,333
  • 10
  • 112
  • 145
1
vote
2 answers

Rails Whenever gem cron fe_sendauth: no password supplied

I am running a Rails server that periodically runs a rake task using whenever gem and cron. I can run the rake task using these successfully. On my remote server, I am running that as the root. This second attempt also works. …
Wraithseeker
  • 1,884
  • 2
  • 19
  • 34
1
vote
1 answer

Cron job doesn't work with whenever gem

I want to create a schedule cron job. I used whenever. My rails version is 4.1.6 and I am in osx. So I created a schedule cron job to test. schedule.rb every 1.minutes do runner…
volt
  • 347
  • 5
  • 19
1
vote
1 answer

Capistrano + whenever + db database.yml not found

I'm trying to run Capistrano 2.15.5 with Whenever 0.8.4 and Ruby 2.0.0 I've added set :whenever_command, "bundle exec whenever" require "whenever/capistrano" to the end of my deploy.rb file and it always run: /releases/20150910075216 && bundle exec…
David
  • 825
  • 10
  • 33
1
vote
1 answer

track logs for scheduler using Whenever gem, Ruby and sinatra

I have written scheduler using "Whenever Gem", where I have 2 schedulers in my scheduler.rb file. I want to get the logs from the scheduled tasks, so I have set :output, "log/cron_log.log" in scheduler.rb. currently all the logs for all the…
joe
  • 217
  • 2
  • 10
1
vote
1 answer

How can I run my rails "whenever"/cron tasks on OpenShift?

When generating tasks via the whenever gem, the resulting line in cron format looks something like this: 0 13 30 * * /bin/bash -l -c 'cd $OPENSHIFT_REPO_DIR && bin/rails runner -e production "puts \"test\""' Now, when I SSH into the OpenShift app…
user569825
  • 2,369
  • 1
  • 25
  • 45