Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: using Rufus-Scheduler as an alternative to cron #72

Closed
jmfarina opened this issue May 5, 2015 · 3 comments
Closed

Documentation: using Rufus-Scheduler as an alternative to cron #72

jmfarina opened this issue May 5, 2015 · 3 comments
Assignees
Milestone

Comments

@jmfarina
Copy link

jmfarina commented May 5, 2015

Hello! I've used Rufus-Scheduler to check for recurrences, instead of Crontab. Maybe you'd like to add that to the documentation, as an alternative to Crontab? I'm no expert on the subject, but it seems to work and for what I've read, it should be faster and lighter in terms of resources than calling the task via crontab.
Anyway, here's the configuration I've used:
Create a task in $REDMINE_HOME/config/initializers. Say, for instance, recurring_tasks.rb. Add something like this:

require 'rubygems'
require 'rake'
require 'rufus-scheduler'

load File.join(Rails.root, 'Rakefile')

scheduler = Rufus::Scheduler.new
scheduler.cron '5 0 * * *' do
  task = Rake.application['redmine:recur_tasks']
  task.reenable
  task.invoke 
end

where in scheduler.cron you can specify the frequency in a similar fashion as you would with crontab. In the example it's set to run every day at 00:05.
You can check Rufus-Scheduler's documentation in https://github.com/jmettraux/rufus-scheduler (there are other options besides scheduler.cron).
I got the idea and base configuration file from http://www.redmine.org/projects/redmine/wiki/RedmineReceivingEmails#Schedule-email-receiving-with-Rufus-Scheduler

Thanks for the plugin, it's very useful!

@nutso
Copy link
Owner

nutso commented Jun 14, 2015

Thanks, added a pointer to this thread alongside the cron documentation.

@nutso nutso closed this as completed Jun 14, 2015
@nutso nutso added this to the v1.5.0 milestone Jun 14, 2015
@nutso
Copy link
Owner

nutso commented May 3, 2016

@olmayanaergi I'm not sure I understand the question. Please open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
@nutso @jmfarina and others