无法使用Django运行Cron作业

时间:2018-06-26 07:07:22

标签: python django cron

我点击了此链接以安排cron作业: https://github.com/kraiz/django-crontab 但是,它不起作用。这是我的代码片段。 settings.py:

CRONJOBS = [
('2 * * * *', 'LeaveManagement.cron.team_notification' , ' >> /home/nineleaps/Nineleaps/LeaveTracking/cronLog.log')]

cron.py:

def team_notification():
     send_mail("Test", "Hey", 'settings.EMAIL_HOST_USER', ['mahima@nineleaps.com'],fail_silently=False)

运行crontab -l命令可提供以下信息:

  

2 * * * * / home / nineleaps / Nineleaps / LeaveTracking / venv / bin / python /home/nineleaps/Nineleaps/LeaveTracking/manage.py crontab运行5f84ef47012b65076a7f598581193a10 >> / home / nineleaps / Nineleaps / LeaveTracking / crontab。日志2>&1#django-cronjobs用于LeaveTracking

0 个答案:

没有答案