I have a long running script which issues several sudo
prefaced commands. The execution time of the script is variable, and occasionally sudo
times out while the script is running, meaning that I need to re-enter the password.
How can I run this script without needing to check the program and make sure it's still going?
If the script itself is run as
sudo
, it will not time out until the script has finished running. To ensure thatsudo
is used to run the script, I inserted the following lines near the top of my script:This ensures that the script has been started with
sudo
, and does not make any attempt to store passwords...