Skip to content

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

@jmfarina

Description

@jmfarina

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!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions