为什么直接执行shell脚本可以,但crontab下执行错误
来源:互联网 发布:高速公路机电系统优化 编辑:程序博客网 时间:2024/06/07 14:35
刚才写好了一个shell脚本,能够正常运行,但是加入crontab内总是给我报错,说我ifconfig命令找不到。查看邮件看到crontab 也有自己的环境
X-Cron-Env: <XDG_SESSION_ID=67>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/1000>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/home/redhat>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=redhat>
X-Cron-Env: <USER=redhat>
PATH=/usr/bin:/bin,和我redhat下的PATH不一样,可能没有一些命令的路径,比如ifconfig,所以在写脚本时候最好用绝对路径。
0 0
- 为什么直接执行shell脚本可以,但crontab下执行错误
- 为什么直接执行shell脚本可以,但crontab下执行错误
- Crontab定时脚本语句无效,直接执行脚本就可以
- crontab执行shell脚本和直接运行的结果不一样
- crontab 定时执行shell脚本
- crontab 定时执行shell脚本
- crontab 定时执行shell脚本
- crontab执行php或执行shell脚本
- shell脚本直接执行没有问题,crontab定时执行失败的解决方法
- shell脚本直接执行没有问题,crontab定时执行失败的解决方法
- linux直接执行shell脚本正常,使用定时任务crontab执行出错
- shell脚本直接执行没有问题,crontab定时执行失败的解决方法
- linux/unix/centos下直接执行脚本可以成功,但是放在crontab里面就不行~解释如下
- shell 脚本执行错误
- 执行shell脚本错误
- linux 定时执行shell脚本 crontab
- linux crontab 无法执行shell脚本解决方法
- Crontab 让linux定时执行shell脚本
- 多重背包转01背包/母函数(1171)
- 使用spring web flow遇到的问题-1
- UEFI模式下安装ubuntu14.04和windows8.1双系统
- iOS-网络七层模型&&网络数据包
- LeetCode Lowest Common Ancestor of a Binary Search Tree
- 为什么直接执行shell脚本可以,但crontab下执行错误
- ViewPager中requestDisallowInterceptTouchEvent
- Android中Activity四种启动模式和taskAffinity属性详解
- 新的一年,要开始写博客了!
- 华为机试题:Arrange an Array to Form a Smallest Digit
- Linux--ubuntu 14.04 install g++问题
- dx11学习笔记-3.三维空间变换(自己整理,基础详尽)
- hdu3247Resource Archiver (AC自动机+最短路+状压dp)
- andriod开发