linux定时任务crontab - 执行shell错误运行,需要添加其他指令解禁

1.原因

crontab 缺少执行配置文件

2.解决

添加

source /etc/profile
source ~/.bash_profile

具体例子如下

#!/bin/sh

source /etc/profile
source ~/.bash_profile

下面写自己的代码

 

posted @ 2024-08-15 15:16  岑惜  阅读(39)  评论(0)    收藏  举报