shell正常运行,加入定时任务执行失败时间:2023-03-08 23:49:34 例如简单的ifconfig命令,在shell中运行成功,但是在crontab 中执行失败。 定位原因:环境变量 解决方案: whereis ifconfig 然后在shell中加入: PATH=PATH:/sbin 然后可以验证在crontab中也可以正常运行了