summaryrefslogtreecommitdiffstats
path: root/home-refresh
diff options
context:
space:
mode:
authoramnesia <amnesia@boum.org>2009-06-20 21:09:15 +0200
committeramnesia <amnesia@boum.org>2009-06-20 21:09:15 +0200
commit345a927fbd6aa18a2bcd13331cbc2e22ef2e0639 (patch)
tree1e107ba0a446a2cb32322f8e9dee1704fe10e5fb /home-refresh
initial source tree import0.1
/home/amnesia is missing, as no clean way to include it is implemented yet.
Diffstat (limited to 'home-refresh')
-rwxr-xr-xhome-refresh29
1 files changed, 29 insertions, 0 deletions
diff --git a/home-refresh b/home-refresh
new file mode 100755
index 0000000..02164f2
--- /dev/null
+++ b/home-refresh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+. config/amnesia
+if [ -e config/amnesia.local ] ; then
+ . config/amnesia.local
+fi
+
+# How to use $TAR_OPTS:
+# - $TAR_OPTS should be used unquoted
+# - 'set -o noglob' has to be run before any $TAR_OPTS use
+# - 'set +o noglob' has to be run after any $TAR_OPTS use
+TAR_OPTS=""
+set -o noglob
+for pattern in $AMNESIA_HOME_EXCLUDES; do
+ TAR_OPTS="$TAR_OPTS --exclude=$pattern"
+done
+set +o noglob
+
+echo "Deleting old home.tar.bz2"
+rm home/home.tar.bz2
+
+echo "Creating new home.tar.bz2"
+set -o noglob
+tar \
+ jcf home/home.tar.bz2 \
+ --atime-preserve --same-owner --numeric-owner --same-permissions \
+ $TAR_OPTS \
+ /home/amnesia
+set +o noglob