我正在尝试在服务器中设置一个cron作业,我在cron选项卡中写了这行:
DJANGO_SETTINGS_MODULE=settings_local PYTHONPATH=$HOME/django-locate:$HOME/locate/locate python manage.py testcommand
但我收到var/mail/myname
错误,说找不到manage.py.
我在这里做错了什么?
这是我的cronjob:
class Command(BaseCommand):
args = "<test cron job>"
help = "writes locations from other server"
def handle(self,*args,**options):
self.stdout.write("cron job is running - it is just a test ")
答案 0 :(得分:2)
manage.py
不在cron的当前目录中。在运行之前更改当前目录,或提供脚本的完整路径。