Fork me on GitHub

crontab定时任务 不起作用

不知道具体原因,非root用户,通过crontab设置定时任务不起作用

解决方法:

00 03 * * * . /etc/profile; /bin/sh /mnt/test1.sh
01 03 * * * . /etc/profile; /bin/sh /mnt/test2.sh

注意一定要添加“ . /etc/profile;" ,这句用于将环境变量include进当前脚本的执行环境!
否则不执行

posted @ 2017-04-12 14:36  夏天海岸线  阅读(1307)  评论(0编辑  收藏  举报