解决手动运行脚本执行正常而放入crontab后不正常的方法

栏目: 服务器 · Linux · 发布时间: 6年前

内容简介:解决手动运行脚本执行正常而放入crontab后不正常的方法

有2种解决方法:

1、在 crontab -e 编辑时加入

. /etc/profile;/bin/sh #主要"."后要有个空格

#例子
0 12 * * * . /etc/profile;/bin/sh /your/sh/your_sh.sh

2、在你要运行的脚本的开头加入

source /etc/profile

以上所述就是小编给大家介绍的《解决手动运行脚本执行正常而放入crontab后不正常的方法》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Inside Larry's and Sergey's Brain

Inside Larry's and Sergey's Brain

Richard Brandt / Portfolio / 17 Sep 2009 / USD 24.95

You’ve used their products. You’ve heard about their skyrocketing wealth and “don’t be evil” business motto. But how much do you really know about Google’s founders, Larry Page and Sergey Brin? Inside......一起来看看 《Inside Larry's and Sergey's Brain》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试