#!/bin/sh -ex if [ -n "`cd /etc; bzr modified`" ]; then echo "uncommitted changes in /etc, aborting" >&2 exit 1 fi # push /etc/ (cd /etc; HOME=/root bzr push) CURBACKUP=`ls -t /var/backups/pibackup/full* | head -n 1` [ -e "$CURBACKUP" ] || { echo no current full backup in /var/backups/pibackup exit 1 } cp $CURBACKUP /home/ apt-get autoclean mkdir -p /home/aptcache rm -rf /home/aptcache/* cp /var/cache/apt/archives/*.deb /home/aptcache/