django-crontab
django-crontab copied to clipboard
Why we can't add individual job and can't remove individual job to crontab
Environment & Versions
- Operating system:
- Python:
- Django:
- django-crontab:
Settings
- My
django-crontab
settings:
# crontab job for mail alerts
CRONJOBS_LOG_DIR = r"/var/log/celery3"
CRONJOBS_ERR_LOG = "cronjob_beat.log"
CRONTAB_COMMAND_SUFFIX = '2>&1'
CRONJOBS = [
('*/60 * * * *', 'integrations.notification_util.trigger_updates_inbox', '>> {} 2>&1'.format(os.path.join(CRONJOBS_LOG_DIR, CRONJOBS_ERR_LOG))),
('*/30 * * * *', 'integrations.notification_util.trigger_updates_proc', '>> {} 2>&1'.format(os.path.join(CRONJOBS_LOG_DIR, CRONJOBS_ERR_LOG)),
]
Details
- Output of
crontab -l
after runningpython manage.py crontab add
.
Then both jobs will be added .
- Output of
crontab -l
after runningpython manage.py crontab remove
.
Then both jobs will be removed.
- If this output contained a
crontab run
command and I copy this command to my terminal the job works: yes/no
CRONJOBS
in settings
is a list. All elements in the list will get added to cron. If you do not want to add a job, then you will have to remove it from the list.