且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

cron python文件在centos 7上不起作用

更新时间:2023-08-24 13:38:10

在shell中键入 crontab -e ,这将打开cron编辑器。在这里复制粘贴整个命令。

Type crontab -e in the shell, this will open the cron editor. Here copy paste the entire command.

* / 5 * * * * / usr / local / bin / python / home / Documents / SCRAPE_PYTHON / SCRAPE.py& gt; /home/Desktop/log.txt

现在按 Esc 键,然后键入冒号:wq!并按 Enter 键。这将安装您的cron。您的cron应该每5分钟运行一次。

Now press Esc key then type colon :wq! and press Enter key. This will install your cron. Your cron should run every 5 minutes.

您的标准输出和错误将附加到 /home/Desktop/log.txt 中。

Your standard output and error will be appended to /home/Desktop/log.txt.