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

Bug#62186: apt-get automated downloads suggestion



package: apt
severity: wishlist


 I've got a useful cron job that uses apt-get to download all the updated
packages into the cache.  It is the same one I asked about on debian-devel a
couple weeks ago.  It's run fine for me every Sunday morning, so I think
it's good enough to pass along to you guys. 

 It lets apt-get dist-upgrade run without having
to download anything more, as long as you don't apt-get update again between
the cron job running and running apt-get dist-upgrade.  I suggest that this
should go in an example or even somewhere 
more prominent where people will notice it, because it makes updating Debian
very nice.  It also cuts down on network usage during daytime hours.  

warning: some of the suggestions for ppp are untested.  I don't use ppp any
more, so I may be getting it a bit wrong (also, I think we should be saying
if-up and if-down, to use the Debian scripts.).  Also, I'm not sure that the
anacron suggestion makes sense, since users would not want it to "catch up"
on the updates it missed as soon as they turned on the machine.

# /usr/share/doc/apt/examples/apt.cron

# This cron job fetches the list of available packages (update), 
# deletes old ones from the cache (autoclean),
# and fetches all updated ones into the cache (-d dist-upgrade)
# see apt-get(8)
# For this too work, you must have already configured sources.list so apt-get
# works when you run it by hand, and you must have a internet access.
# Put the uncommented line below in /etc/crontab, after changing it as
# recommended below to suit your system.  (see cron(8) and crontab(5).)
# You might want to run the commands from anacrontab if you sometimes leave
# your system not running Debian.  See anacron(8).

# The update runs at 04:42 on sunday morning.  This is probably a relatively
# quiet time for the network link between you and the server(s) in your
# sources.list.  It is a good idea to pick a random time, so not every
# Debian user hits the mirrors at the same time!  Good times are from around
# 03:00 to 07:00.  If your connection is over a modem, you should probably
# pick an earlier time to ensure that things complete by the time you get
# and want to use the phone in the morning!  (especially if you are an early
# riser, which I'm not :)

#min hour day month day-of-week 
42   4	  *	*	sun	root	apt-get update && apt-get autoclean && apt-get -q -d -y -u dist-upgrade

# if you have a dialup internet connection, you should change the
# command to run something like this:
# pppd call ISP && apt-get update && apt-get autoclean && apt-get -q -d -y -u dist-upgrade; killall pppd


-- 
#define X(x,y) x##y
DUPS Secretary ; http://is2.dal.ca/~dups/
Peter Cordes ;  e-mail: X(peter@cordes.phys. , dal.ca)

"The gods confound the man who first found out how to distinguish the hours!
 Confound him, too, who in this place set up a sundial, to cut and hack
 my day so wretchedly into small pieces!" -- Plautus, 200 BCE


Reply to: