TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
apt-get for bandwidth <= 56K
Place this script in your /etc/cron.daily (which fires off at around 6am if I
remember correctly -- editable in /etc/crontab).
## ---- CUT HERE ---- ##
#!/bin/bash
# Apt-get package update and download (but not install)
# Need: apt-get, command line mail program (mailx, sendmail, mh), date
#
# Comment out the mail lines if you don't have an MH
# Edit the script to place temp files where you wish, then
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
APT=`which apt-get`
DATE=`which date`
MAIL=`which mailx`
[ -x ${APT} ] && [ -x ${DATE} ] && [ -x ${MAIL} ] || exit 0
# Update package list
TEMPFILE=apt-get.`${DATE} +\%s`
${APT} update &> /tmp/${TEMPFILE}
${MAIL} -s "${TEMPFILE} (update)" < ${TEMPFILE}
# Download and list all packages to upgrade
TEMPFILE=apt-get.`${DATE} +\%s`
${APT} dist-upgrade -y -u -d &> /tmp/${TEMPFILE}
${MAIL} -s "${TEMPFILE} (update)" < ${TEMPFILE}
## ---- CUT HERE ---- ##
--
^chewie
PGP signature