當前位置:首頁 > IT技術(shù) > 系統(tǒng)服務(wù) > 正文

shell程序的編寫
2021-09-06 19:18:00

1.文件后綴名:?

.sh

2.Run.sh文件內(nèi)容如下所示:

cd /root/front/dicns && /root/front/dicns/envs/bin/python /root/front/dicns/run.py

3.之后使用程序運行shell文件即可(我這里結(jié)合的是crontab運行的,所以在crontab -l 命令顯示的文件中編寫的)。

*/2 * * * * /root/front/dicns/Run.sh

如下圖所示:

4.使用命令,重新啟動crontab服務(wù):

service cron restart

5.根據(jù)設(shè)定的時間,定時執(zhí)行的程序就可以執(zhí)行。

6.可以根據(jù)日志,去查看cron的執(zhí)行情況

?

本文摘自 :https://www.cnblogs.com/

開通會員,享受整站包年服務(wù)立即開通 >