[SATLUG] Script

Chris Lemire good_bye300 at yahoo.com
Sun Oct 1 11:18:16 CDT 2006


Here's my script I wrote for doing system updates by
cron  in the early morning after I leave to school.
Anyone can use it. Just change the values, make it
executable and link it to /etc/cron.daily/. Also, for
this one, you must have sendmail and a program
installed called sendEmail.

#!/bin/bash
apt-get update
apt-get upgrade -y
echo "----------------------------------------------"
>> /tmp/mylog
echo "Apt successfully updated the system:" >>
/tmp/mylog
echo $(date) >> /tmp/mylog
echo >> /tmp/mylog
ls -l /var/cache/apt/archives/ >> /tmp/mylog
echo >> /tmp/mylog
cat /tmp/mylog | sendEmail -t
christopher.lemire at gmail.com -f root at chris1.myftp.org
-u "Apt successful system update" -q
cat /tmp/mylog | tee -a /var/log/pkgsbyapt
rm -f /tmp/mylog
apt-get clean
exit 0

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the SATLUG mailing list