Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the advantages of celerybeat over cron?

I see many people preferring celerybeat over cron jobs for periodic tasks. I see the documentation for celerybeat and I can see information on how to use it, but not why (or when) I should prefer it over cronjobs.

http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#introduction

like image 360
shabda Avatar asked Oct 03 '22 21:10

shabda


1 Answers

I have used both and have come to the conclusion that beat is better at control than cron.

You can wire it up so that your control is via django admin instead of sshing in and changing the crontab. Also, there is an implicit portability when using beat - meaning you can move it from machine to machine by way of configuration instead of a login.

Of course, there are disadvantages as well but they are few. We used to use pid files to control the singleton aspect of a job but now we use a generic database semaphore table (other people have used memcache, but I just don't feel comfortable with that).

like image 173
Christian Jensen Avatar answered Oct 10 '22 03:10

Christian Jensen