Last active
January 16, 2021 23:11
-
-
Save mvidaldp/f3a49fcb21c3034eda3771bc78d21b49 to your computer and use it in GitHub Desktop.
Example systemd unit service to schedule a reboot/shutdown at a specific time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Shutdown at specific time | |
After=network.target | |
StartLimitIntervalSec=0 | |
[Service] | |
Type=simple | |
# remove the scheduled shutdown if any | |
ExecStartPre=/sbin/shutdown -c | |
# change to desired time, -r (restart), -P (poweroff/shutdown) | |
ExecStart=/sbin/shutdown -r 00:00 | |
[Install] | |
WantedBy=default.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment