Rails scheduled task timing execution plug-in

Source: Internet
Author: User

Recently, we need to implement the weekly report's regular statistics and sending function on redmine. This will inevitably require rails's scheduled task function. I searched the internet and found these plug-ins, here, we will list them for your reference only:

1. backgroundrb

Official Website:Http://backgroundrb.rubyforge.org/

In fact, the main function of this plug-in is to allow the rails application to put long-time operations in the background process for execution, so as to avoid waiting for front-end users. As to whether the task can be executed, I have made many comments online.

Http://www.javaeye.com/topic/149342

As mentioned on the official website:

====================

Invoking tasks

TaskCharge_customerDefined inBillingworkerCan be invoked in several ways. to beging with it can be invoked from rails or can be scheduled to execute at particle interval using cron like syntax.

====================

Backgroundrb can call these predefined workers in multiple ways, including ① calling in rails; ② using a scheduled task similar to cron in LinuxProgram) The syntax runs at a specified interval.

But it does not seem to be able to run at the specified time point.

2. Rufus-Scheduler

Official Website:Http://rufus.rubyforge.org/rufus-scheduler/

Introduction on the official website:

====================

Rufus-scheduler is a ruby gem for scheduling pieces of code (jobs ). it understands running a job at a certain time, in a certain time, every X time or simply via a Cron statement.

Rufus-scheduler is no replacement for cron/at since it runs inside of Ruby.

====================

The most attractive point is that you can execute the specified job at the specified ① time point ② time period ③ time interval.

Introduction on another blog: http://hi.baidu.com/ma95221/blog/item/cec152c4a7e782a08326ace1.html

3. railscron

Official Website:It seems that no updates are available on the official website.

I saw it here: http://hlee.javaeye.com/blog/438511

The URL provides an overview of its usage. In the comments, another senior friend mentioned some issues about railscron, including the author's suggestion that you use railscron instead of backgroundrb or daemon_generator.

4. daemon_generator

Author's blog:Http://kylemaxwell.typepad.com/everystudent/2006/08/after_writing_r.html

I saw it here: http://douglasfshearer.com/blog/cron-jobs-in-ruby-on-rails (a foreign site)

The website provides instructions on how to use it.

It looks good, but it seems that the download link is not found. O (Clerk □clerk) O

 

To sum up, I personally think that the second plug-in refus-scheduler is more suitable for me and is a version that can be downloaded (using gem ).

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.