aisledotnet Posted October 6, 2016 Share Posted October 6, 2016 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 Paul 1 Link to comment Share on other sites More sharing options...
aisledotnet Posted October 11, 2016 Author Share Posted October 11, 2016 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now