Results 1 to 3 of 3

Thread: Shell script for installing updates

  1. #1

    Shell script for installing updates

    Hello all.

    I'm looking to put together a script, called by a cron job on a daily (or weekly) basis, to automatically have apt-get pull down and install all updates, followed by a re-boot.

    Anybody care to venture anything?

    Cuddles for the winner.

  2. #2
    Join Date
    May 2008
    Location
    Cluj, Romania
    Beans
    1,292

    Re: Shell script for installing updates

    Reboot? What, are you running Windows or something?
    Reboot is only required on kernel update or the like.
    Not to talk about the implications - picture yourself doing something when the computer suddenly reboots. Not nice... even vorse than Windows.

    I have a very simple bash script i use for updates:

    #!/bin/bash
    sudo aptitude update ; sudo aptitude upgrade

    I use this logged in as user.
    If you modify it to something like this:

    #!/bin/bash
    aptitude update ; aptitude upgrade -y && reboot

    it probably will do the job. But the problem is that you wont know what really happens if it runs and can mess up your system in some cases when packages are automatically removed.

  3. #3

    Re: Shell script for installing updates

    Thanks, those look useful.

    Yes, I was referring to wanting to re-boot in the case of kernel updates. The machine itself is effectively just a notice board device, and so no-one will be using it in the middle of the night

    I'll take a look at using these.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •