1. 程式人生 > >crontab 執行不成功,指令碼手動執行成功

crontab 執行不成功,指令碼手動執行成功

請確保手工可以執行該檔案(給sh檔案增加X許可權 chmod +x )

確認開始crond服務(service crond status/start/stop)

如果看到crond is running 依舊不能執行的話,請重啟crond,依舊不行,

那麼給sh檔案制定bash環境

if [ -f ~/.bash_profile ];
then
  . ~/.bash_profile
fi

重啟crond 服務

service crond restart