b956536180 大佬有话说 :
求问在座位各位大佬Crontab执行问题
本帖最后由 b956536180 于 2021-6-10 18:29 编辑
今天没事尝试一下rules-panel面板,其中客户端有一句
*/5 * * * * . /etc/profile;/root/ip_table key123 10.0.0.4 https://baidu.com/api
定时任务,环境是Ubuntu16,这句话手动执行没有任何问题,放到crontab里就行,尝试过很多方案。
1:换到脚本里执行
2:更改为source /etc/profile
都不可以,求问在座的大佬,感谢
Liu`e 大佬有话说 :
放到 shell脚本里面不就好了
b956536180 大佬有话说 :
Liu`e 大佬有话说 : 2021-6-10 18:27
放到 shell脚本里面不就好了
放进去了,也不执行。手动执行放进去的脚本就好了。。。尴尬啊
cicvc 大佬有话说 :
看crontab的日志
b956536180 大佬有话说 :
cicvc 大佬有话说 : 2021-6-10 18:30
看crontab的日志
Jun 10 10:35:01 li1885-141 CRON: (root) CMD (./etc/profile;/root/ip_table key123 10.0.0.4 https://baidu.com/api)
Jun 10 10:35:01 li1885-141 CRON: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Jun 10 10:35:01 li1885-141 CRON: (CRON) info (No MTA installed, discarding output)
longhtml 大佬有话说 :
命令末尾加>/dev/null2>&1
b956536180 大佬有话说 :
longhtml 大佬有话说 : 2021-6-10 18:36
命令末尾加>/dev/null2>&1
不好使,大佬,