- 论坛徽章:
- 0
|
cron invokes the command from the user’s HOME directory with the shell, (/usr/bin/sh).
cron supplies a default environment for every shell, defining:
HOME=user’s-home-directory 当前路径为用户家目录
LOGNAME=user’s-login-id 登陆用户为用户id
PATH=/usr/bin:/usr/sbin:. PATH只有这2个
SHELL=/usr/bin/sh 默认的sh
Users who desire to have their .profile executed must explicitly do so in the crontab entry or in a script called by the entry.
如果用户想要自己定义的环境那么 必须在crontab条目设置环境 或者在被cron调用的脚本内部设置环境
根据以上得知,shudown命令不在/usr/bin:/usr/sbin 所以你得用绝对路径了 |
|