https://github.com/jmettraux/rufus-scheduler 指出:

rufus-scheduler是一个Ruby gem,用于调度代码段(作业)。它理解在某个时间、某个时间、每x次或仅仅通过CRON语句运行一个作业。

rufus-scheduler不是cron/at的替代品,因为它在Ruby内部运行。

那么如果它在ruby内部运行呢?我不能在ruby中使用system命令访问cron吗?

有帮助吗?

解决方案

我认为rufus-scheduler是为那些不习惯使用系统的人准备的 crontab, atbatch.

cron 重复/定期作业和 atbatch 用于一次性作业,因为这两个命令不支持自动重复命令。

因此,rufus-scheduler正在创建其他命令的功能,但是如果您对命令行和其他命令感到满意,在我看来,它不会给您带来太多好处。

我没有使用它,但确实查看了源代码,我担心的是它看起来rufus-scheduler依赖于线程,这意味着Ruby会让您的应用程序在后台运行,等待适当的时间或间隔运行。如果进程被杀死,或者机器重新启动,它看起来像作业不会运行,这与系统的命令相比是一个主要的区别,这些命令将在重新启动或应用程序不在内存中。

我们在工作中经常使用cron;这是一个行业标准的工具,每台Linux和Mac计算机都在一天中运行cron计划的作业,尽管大多数用户都不知道它。

其他提示

rufus-scheduler is a "in-ruby-process" scheduler. It is not meant as a cron/at replacement at all.

rufus-scheduler was not meant for people not comfortable with cron/at on the command line, it was meant for people willing to schedule stuff directly inside their ruby process (and understanding what it implies).

If rufus-scheduler was meant as a replacement for cron/at, it would provide some kind of persistence for the jobs, but it does not.

Another take on that : http://adam.heroku.com/past/2010/6/30/replace_cron_with_clockwork/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top