[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: apt-get dist-upgrade cron job



On Mon, 2002-11-18 at 06:00, Joachim Trinkwitz wrote:
> ThanhVu Nguyen <txn131@psu.edu> writes:
> 
> > Hello, how do I set up a cron job that runs "apt-get update; apt-get
> > dist-upgrade -yu" at 6 AM everyday and have all the upgraded result sent
> > to me ?  I already have exim setup to send mail , I just don't know how
> > to write the cron job and use cron ... 
> 
> apt-get install cron-apt ...

I tried cron-apt and I didn't like it because it wasn't very
configurable.  I added a file to /etc/cron.d named apt that runs:\

apt-get update > /dev/null && echo "n" | apt-get -du upgrade

This grabs the latest updated lists (I don't care about seeing the
output, only the errors) then I do an apt-get upgrade with -d (download)
and -u (show me all upgraded packages).  This prompts for a Y/n box, so
I echo "n" before I run the command.

This allows me to get an email with only the packages that need to be
installed.  In my next version, I'd like to have it only send an email
if there are packages to update.

Jeremy

-- 
**************************************************************
Jeremy Turner, Help Desk Supervisor        Phone: 405.425.5555
Email: Jeremy.Turner@oc.edu                Phone: 405.425.1820
Information Technology Services, Oklahoma Christian University
**************************************************************
Linux jturnermac 2.4.19 #10 Mon Oct 14 13:14:58 CDT 2002 ppc unknown
unknown GNU/Linux
 10:10:01 up 21 days, 20:40,  3 users,  load average: 0.01, 0.04, 0.06



Reply to: