@reboot cronjob not executing

后端 未结 4 1104
说谎
说谎 2021-01-15 12:30

I have a Python script which simply writes some text and saves it to a file

#! /usr/bin/python3
def main():
     filename = \'/home/user/testHello.txt\'
             


        
4条回答
  •  长发绾君心
    2021-01-15 12:36

    I managed to get @reboot working with the answer @halfer provided, but want to add an interesting abstract from man 5 crontab

    ... The format of a cron command is very much the V7 standard, with a number of upward-compatible extensions. Each line has five time and date fields, followed by a command, followed by a newline character ('\n'). The system crontab (/etc/crontab) uses the same format, except that the username for the command is specified after the time and date fields and before the command. The fields may be separated by spaces or tabs. The maximum permitted length for the command field is 998 characters. ...

    So you might check these as well in case the job is still not running.

提交回复
热议问题