Want run a bash script as root but delayed. How can achieve this?
sudo "sleep 3600; command" , or
sudo (sleep 3600; command)
does not works.
You can use at
:
sudo at next hour
And then you have to enter the command and close the file with Ctrl+D. Alternatively you can specify commands to be run in a file:
sudo at -f commands next hour
If you really must avoid using cron: sudo sh -c "(sleep 3600; command)&"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With