运维网's Archiver
论坛
›
Shell/Powershell
› crontab运行shell脚本报sudo错误
色魔王子7
发表于 2018-8-27 12:54:12
crontab运行shell脚本报sudo错误
报错:
sudo:sorry, you must have a tty to run sudo.
在shell脚本调用perl之前加上sudo,shell脚本单独执行是没有错误的。
解决crontab问题:
chmod 640 /etc/sudoers
sudo vim /etc/sudoers
注释掉: Defaults requiretty。
页:
[1]
查看完整版本:
crontab运行shell脚本报sudo错误