cron job doesn't output to nohup.out

前端 未结 1 1286
不思量自难忘°
不思量自难忘° 2021-02-19 03:42

i have start.sh bash script that is running though CRON JOB on ubuntu server

start.sh contains bellow mentioned line

1条回答
  •  面向向阳花
    2021-02-19 04:01

    Why are you using nohup? nohup is a command that tells the running terminal to ignore the hangup signal. cron, however, has no hangup signal, because it is not linked to a terminal session.

    In this case, instead of:

    nohup scrapy crawl first &
    

    You probably want:

    scrapy crawl first > first.txt &
    

    The last example also works in a terminal, but when you close the terminal, the hangup signal (hup) is sent, which ends the program.

    0 讨论(0)
提交回复
热议问题