Last active
September 10, 2021 18:19
-
-
Save da667/20f1c67c264f7823c7139f5c835a7026 to your computer and use it in GitHub Desktop.
updater shell script
This file contains 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 | |
#updater.sh - Weekly update script | |
#checks for updates, downloads them, then reboots the system. | |
#place this script in /etc/cron.weekly, ensure it is owned by root (chown root:root /etc/cron.weekly/updater) | |
#ensure the script execute permissions (chmod 700 /etc/cron.weekly/updater) | |
#if you want updates to run once daily or monthly, you could also place this script into cron.daily, or cron.weekly. | |
#alternatively, edit /etc/crontab to create a crontab entry. | |
export DEBIAN_FRONTEND=noninteractive | |
apt-get -q update | |
apt-get -y -q dist-upgrade | |
logger updater cron job ran successfully. rebooting system | |
init 6 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment