So I was pretty tired of updating every single server I was messing around with for experimental purpose so I decided to create an auto scripting for the usual ‘apt update && apt upgrade’ command
Go to your server
ssh root@example.com
Go to the folder where Cron exists. Cron is a time-based scheduler that allows daily, weekly, monthly and custom scripting. https://help.ubuntu.com/community/AutoWeeklyUpdateHowTo
cd /etc/cron.weekly
If I wanted it to run the updates and upgrades on a daily basis, it would be ‘cron.daily’. So in the directory where you wish to schedule your auto script, create a file using any editor of your choice (vim for me)
vim auto_update
In the file add
apt update && apt upgrade -y
apt autoclean
apt autoremove
‘apt
‘apt
Now, to make the file executable in order for
chmod 755 auto_update
Some other stuff you can do is to find files in example directory with size >+30GB and execute remove
find ~/example -type f -size +30000M -exec rm {} \;