Ubuntu – shutdown ubuntu server after 2 days at midnight

shutdownUbuntu

without using a cronjob how would I have a ubuntu server shutdown after 2 days (2880 minutes) at midnight?

The essence of what I want to do is this:

bash
shutdown -r +2880 00:00

which would tell shutdown to shutdown after 2880 minutes, but to make sure that it is midnight before actually shutting down.

Best Answer

Use the at command ? I'm a similar way to terdons answer but used instead of sleep. It doesn't require your shell to be left open

Echo "shutdown -h 00:00"|at now + 2 days

For example

Related Question