Skip to content

Instantly share code, notes, and snippets.

@sgqy
Created August 23, 2018 09:27
Show Gist options
  • Save sgqy/c212e763cd977331319e5898821537d5 to your computer and use it in GitHub Desktop.
Save sgqy/c212e763cd977331319e5898821537d5 to your computer and use it in GitHub Desktop.
#!/bin/bash
#LOG=/root/auto/reboot.log
LOG=/dev/null
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
DEBIAN_FRONTEND=noninteractive
echo >> ${LOG}
echo ----- >> ${LOG}
date -Isec >> ${LOG}
echo ----- >> ${LOG}
apt update >> ${LOG} 2>&1
apt dist-upgrade -y --auto-remove --purge >> ${LOG} 2>&1
apt autoclean >> ${LOG} 2>&1
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment