4

In order to build a system to maintain thousands of cron jobs on a Linux system, I'm facing the problem of being able to handle them in a scalable way. I need to use a database (I was thinking of using MySQL) for storing the jobs instead of default plaintext files.

Does anyone know if there is a module or plugin for any cron daemon that can handle this task?

Thank you in advance

ewwhite
  • 197,159
  • 92
  • 443
  • 809
eldblz
  • 385
  • 2
  • 11
  • 21
  • 9
    someone has to ask it. Thousands of cron jobs ?! – Sirex Aug 12 '12 at 23:26
  • Is this a single linux system? Is there no way to add some kind of abstraction to your cronjobs and reduce the quantity? – Zoredache Aug 12 '12 at 23:40
  • Let's say hundred of rsync / curl jobs. However i can think several different scenarios where can be useful to store cron jobs into a database instead of plain text files. – eldblz Aug 12 '12 at 23:41
  • 5
    Your solution probably lies with a "Job Scheduler". There are several commercial and open source solutions, for example this one: http://sourceforge.net/projects/phpjobscheduler/ and this http://www.sos-berlin.com/modules/cjaycontent/index.php?id=72&page=osource_scheduler_features_en.htm – Not Now Aug 13 '12 at 00:01
  • @Not Now : i'll look into SOS-Berlin JobScheduler seems promesing, however i'd like to use native system cron if possible. – eldblz Aug 13 '12 at 17:00
  • It really wouldn't be `"native system cron"` if you're modifying it to use a database backend, would it? – MDMarra Aug 13 '12 at 17:08
  • @eldblz Like MDMarra says, if you want to store jobs in a database, then it is not a "native cron" system. Many job schedulers can use mysql to store jobs. – Not Now Aug 13 '12 at 17:27

3 Answers3

6

What you really need for this is a job scheduler.

Please check this list: http://en.wikipedia.org/wiki/List_of_job_scheduler_software can be useful for you

user9517
  • 115,471
  • 20
  • 215
  • 297
klocek
  • 562
  • 5
  • 11
  • Thank you for your reply, i'll look into SOS-Berlin Job Scheduler seems the most promising. – eldblz Aug 13 '12 at 17:01
5

Another option, assuming you're on an OS that supports the cron.d directory structure, is to break your jobs into individual .cron files and manage them via the configuration management tool of your choice (Puppet, for instance)

Otherwise, go with a job scheduler...

Outgrowing cron: what's the next scheduler?

ewwhite
  • 197,159
  • 92
  • 443
  • 809
0

Here's another possible solution:

https://github.com/bvandenbos/resque-scheduler

Not the same as cron, but if you have temporary or sporadic jobs, Resque is a good option.

Kyle
  • 1,589
  • 9
  • 14
  • unfortunately jobs will be semi-permanent. I'd prefer to use system cron if possibile. Thank you anyway for your kind answer. – eldblz Aug 13 '12 at 16:57