You can check the last_run_at apparently by using the shelve library from Python, which celerybeat uses to store all the scheduled tasks defined in your Celery configurations. Each time you restart Celerybeat, this celerybeat-schedule gets merged with your Celery scheduled tasks. Those that don't exist already are added.
sudo python >>> import shelve >>> shelve.open("/var/run/celerybeat-schedule") >>> a['entries']['my_task'].last_run_at datetime.datetime(2011, 10, 28, 2, 1, 57, 717454)The key is to specify explicitly define the celerybeat-schedule:
/etc/default/celerybeat:
export CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
Did you ever figure out a more reliable way of launching celerybeat via fabric? Doesn't work for me and I need sudo so can't do pty=False
ReplyDelete