报错:
sudo:sorry, you must have a tty to run sudo.
在shell脚本调用perl之前加上sudo,shell脚本单独执行是没有错误的。
解决crontab问题:
sudo vim /etc/sudoers
注释掉: Defaults requiretty。
本文介绍了解决在使用sudo时遇到的“you must have a tty to run sudo”错误的方法。通过修改/etc/sudoers文件并注释掉Defaults requiretty行来解决crontab任务中sudo的tty限制。
报错:
sudo:sorry, you must have a tty to run sudo.
在shell脚本调用perl之前加上sudo,shell脚本单独执行是没有错误的。
解决crontab问题:
sudo vim /etc/sudoers
注释掉: Defaults requiretty。
880

被折叠的 条评论
为什么被折叠?