Created
September 12, 2018 05:39
-
-
Save msnoigrs/f10ab4eb6f981a25e1ba1fe01e8659d0 to your computer and use it in GitHub Desktop.
Auto reboot at midnight using at command
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
#!/bin/bash | |
NEXTDAY=$(date -d '1 days' --rfc-3339='date') | |
ATTIME="00:01 ${NEXTDAY:5:2}${NEXTDAY:8:2}${NEXTDAY:2:2}" | |
sudo at "${ATTIME}" -f /root/reboot.sh |
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
#!/bin/bash | |
/sbin/shutdown -r now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment