命令行能运行,但是在crontab不能正常运行的问题

今天配置了一个crontab,但是怎么也不能执行,原因是环境变量的问题,记录一下。

解决问题的办法,在shell脚本添加:

##################
. /etc/profile
. ~/.bash_profile
##################

查看crontab是否执行了,可以查看:

tail -f /var/log/cron
原文地址:https://www.cnblogs.com/liqiu/p/3792494.html