红联Linux门户
Linux帮助

关于linux Shell crontab执行当前环境变量

发布时间:2016-01-16 10:38:39来源:linux网站作者:selaginella

在linux中,执行定时任务时,在crontab中配置执行的shell脚本,如果不配置当前环境变量,会执行默认的环境变量,执行不会使用当前的环境变量,如果需要使用当前的环境变量,需要在crontab后面加入当前环境变量的.profile文件参数。如下图箭头所示:

关于linux Shell crontab执行当前环境变量

在crontab中调用run.shll中加入当前的环境环变量: .  .profile,如下图所示。

关于linux Shell crontab执行当前环境变量


ubuntu14.04开启crontab日志:http://www.linuxdiyf.com/linux/16289.html

Ubuntu查看crontab运行日志:http://www.linuxdiyf.com/linux/16106.html

Crontab运行php脚本:http://www.linuxdiyf.com/linux/5453.html

Linux定时任务(crontab)实例:http://www.linuxdiyf.com/linux/13202.html

Linux中crond服务与crontab用法:http://www.linuxdiyf.com/linux/11240.html