报错:
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’错误的方法。通过在shell脚本中调用sudo前进行适当配置,并修改/etc/sudoers文件中的设置来避免此问题。
报错:
sudo:sorry, you must have a tty to run sudo.
在shell脚本调用perl之前加上sudo,shell脚本单独执行是没有错误的。
解决crontab问题:
sudo vim /etc/sudoers
注释掉: Defaults requiretty。

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