#!/bin/sh -e
+# move backup to /var
+if [ -d /home/martin/backup ] && [ ! -d /var/backups/martin ]; then
+ cp -a /home/martin/backup /var/backups/martin
+fi
+
# install already shipped debs
[ -e /mirror ] || ln -s /home/ubuntu-mirror /mirror
mount -o loop /home/martin/download/ubuntu/gutsy-alternate-amd64.iso /cdrom
# crontabs
crontab -u martin - <<EOF
# m h dom mon dow command
-05 * * * * \$HOME/bin/backup
+05 * * * * \$HOME/bin/backup >/dev/null
EOF
# 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
+# copy backup to ~
+if [ -d /home/martin/backup ]; then
+ echo "/home/martin/backup exists already, aborting" >&2
exit 1
-}
-cp $CURBACKUP /home/
+fi
+cp -a /var/backups/martin/ /home/martin/backup
apt-get autoclean
mkdir -p /home/aptcache