Question

https://github.com/jmettraux/rufus-scheduler states that:

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.

so what if it runs inside ruby? can't i access cron using the system command in ruby?

Was it helpful?

Solution

I think rufus-scheduler is for those people who aren't comfortable using the system's crontab, at or batch.

cron does repeating/periodic jobs and at and batch are for one-time jobs because those two commands don't support automatically repeating commands.

So rufus-scheduler is creating the functionality of the other commands, but if you're comfortable at the command-line and with the other commands, it doesn't buy you much in my opinion.

I haven't used it, but did look through the source, and my concern is that it appears rufus-scheduler relies on threads, which mean Ruby will keep your app running in the background, waiting for the appropriate time or interval to run. If the process gets killed, or the machine restarts it looks like the job won't run, which is a major difference compared to the system's commands which will persist across reboots or the app not being in memory.

We use cron a lot at work for jobs; It's an industry standard tool, and every Linux and Mac computer is running cron-scheduled jobs all through the day, though most users don't know it.

OTHER TIPS

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top