Skip to content

Instantly share code, notes, and snippets.

@tatticoder
Last active August 28, 2020 18:11
Show Gist options
  • Save tatticoder/62835b894f9cdcb3c6916a6e6ff1f1a6 to your computer and use it in GitHub Desktop.
Save tatticoder/62835b894f9cdcb3c6916a6e6ff1f1a6 to your computer and use it in GitHub Desktop.
Simple script to update Linux packages via terminal
starttime=$(date)
# give path of a text file and un-comment next line to log starting time times
#echo "update Started at $starttime" >>/home/[user]/Desktop/file.txt
sudo apt-get update
sudo apt-get upgrade -y
endtime=$(date)
# give path of a text file and un-comment next line to log finish times
#echo "update completed successfully on $endtime" >>/home/[user]/Desktop/file.txt
shutdown now #shutdown pc
# shutdown -r09:35 #reboot the machine at 09:35am
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment