Jump to content

Recommended Posts

Posted

Hi, maybe this is too simple but I'm using for my Ubuntu machine update. 

Just in case, somebody who also need like me.

 

#!/bin/bash

/usr/bin/apt-get -qy update > /dev/null
/usr/bin/apt-get -qy dist-upgrade > /dev/null
exit 0

Posted

And, some modification with status update email.

 

#!/bin/bash
tmpfile=$( /bin/mktemp -t )
from= xxx@xxxx.xxx
to= yyy@yyyy.yyy
/bin/echo return-path: $to >> $tmpfile
/bin/echo for: $to >> $tmpfile
/bin/echo from: $from >> $tmpfile
/bin/echo to: $to >> $tmpfile
/bin/echo subject: Ubuntu Update Pulseway Script Status >> $tmpfile
/bin/echo Message: >> $tmpfile
/bin/echo >> $tmpfile
/bin/echo APT-GET Update was run: $( /bin/date +%c ) >> $tmpfile
/bin/echo >> $tmpfile
/bin/echo -n "Result: " >> $tmpfile
/usr/bin/apt-get -qy update > /dev/null
/usr/bin/apt-get -qy dist-upgrade | grep -i installed >> $tmpfile
/bin/echo >> $tmpfile
/bin/cat $tmpfile | sendmail -t
/bin/rm $tmpfile
exit 0

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...