It is a short entry, but an useful one, as it is important to have a basic knowledge of how to schedule system reboot or power it down automatically at specified time.
Reboot system now.
$ sudo shutdown -r now
Shutdown system now.
$ sudo shutdown -P now
Reboot system at 14:30.
$ sudo shutdown -r 14:30
Shutdown system after 80 minutes.
$ shutdown -P +80
Cancel pending operation.
$ shutdown -c
Verify pending operation on Debian Jessie (
$ cat /run/systemd/shutdown/scheduled
USEC=1445770800000000 WARN_WALL=1 MODE=poweroff
Verify pending operation on Ubuntu Wily Werewolf using D-Bus.
$ qdbus --literal --system org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.DBus.Properties.Get org.freedesktop.login1.Manager ScheduledShutdown
[Variant: [Argument: (st) "poweroff", 1445770800000000]]
bc commands to pretty print scheduled date.
$ date -d @$(echo "(1445770800000000/1000000)" | bc) Sun Oct 25 12:00:00 CET 2015
This operation can be divided into two steps.
$ echo "(1445770800000000/1000000)" | bc 1445770800
$ date -d @1445770800 Sun Oct 25 12:00:00 CET 2015
/run/systemd/shutdown/scheduledfile as it is not deleted after the whole operation is aborted using