If the command is invoked using the sudo command in the script, a Sudo:sorry is reported, and you must the error of the a TTY to run sudo
For example, writing in a script
sudo mount/dev/sdc/app/backup
Will error Sudo:sorry, you must has a TTY to run sudo, causing the device to not mount correctly
If you must use the sudo command in your script, you need to modify the configuration file/etc/sudoers
Comment out the Default requiretty line
#Default Requiretty
# Disable "ssh hostname sudo <cmd>", because it'll show the password in clear.
# You has to run "ssh-t hostname sudo <cmd>".
#
#Defaults Requiretty
However, when this option is blocked, the sudo command can be executed remotely via SSH, and there is a certain risk
Depends on the environmental requirements and whether it is necessary.
This article is from the "Database Road" blog, make sure to keep this source http://dbaway.blog.51cto.com/7099215/1683939
sudo error is invoked in the script, causing the device not to mount correctly