Linux (Debian/Ubuntu) Automatic Update Cronjob


The folllowing steps will create a cronjon for updating Ubuntu or Debian linux at 12:50hrs

Login into the machine with administrator account

On the terminal run the following command:

sudo -s
touch /updates.txt
chmod +x updates.txt

Edit /updates.txt file and add paste the following:

apt-get update -y && apt-get dist-upgrade -y && apt-get install -f && apt-get -y autoclean -y && apt-get autoremove -y

Run:

crontab -e

if this is your first to run crontab, you will be prompted to select your prefered text editor

Paste the following text, save and exit the editor:

50 12  * * * /updates.txt

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>