运行这一句:
curl -L https://git.io/vigfN | bash
参考 braker-scripts/working-scripts/add_current_shell_and_path_to_crontab.sh
运行这一句:
curl -L https://git.io/vigfN | bash
参考 braker-scripts/working-scripts/add_current_shell_and_path_to_crontab.sh
1
doyel Sep 13, 2016
反正知道这毛病我所有 crontab 都直接写绝对路径。。
|
3
doyel Sep 13, 2016
那倒是,碰到取环境变量就抓瞎了
|
5
ivanfjz Sep 13, 2016
ubuntu 读环境变量的。 centos 不读
|
6
lizheming Sep 13, 2016
vim /etc/crontab
service crontab restart 试试... 不过保险起见还是写绝对路径吧...=。=|| |
7
walkman660 Sep 13, 2016
不自动那就自己加载环境变量
source /etc/profile |
8
cxbig Sep 13, 2016
求稳妥,所有命令和文件用绝对路径,环境变量直接先赋值,如果比较多就放文件里提前 source 一下
|
10
skydiver Sep 13, 2016
自己把 PATH 写到 crontab 里就行了。
这脚本干的一样的事儿 |
11
thiswind OP |
13
dreamtrail Sep 14, 2016
第一行加上 PATH=/usr/local/bin:/bin:/usr/bin:/usr/sbin:/sbin 就行了
|