]> piware.de Git - bin.git/blobdiff - preinst-backup
add backup/restore scripts
[bin.git] / preinst-backup
diff --git a/preinst-backup b/preinst-backup
new file mode 100755 (executable)
index 0000000..23d2b88
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh -ex
+
+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/
+