]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
archive.sh: Add, creates an archive of important files.
authorSimon Ruderich <simon@ruderich.org>
Sun, 7 Mar 2010 15:15:07 +0000 (16:15 +0100)
committerSimon Ruderich <simon@ruderich.org>
Sun, 7 Mar 2010 15:15:07 +0000 (16:15 +0100)
archive.sh [new file with mode: 0755]

diff --git a/archive.sh b/archive.sh
new file mode 100755 (executable)
index 0000000..4a205a2
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Create an archive of my configuration file which can be uploaded on a
+# server.
+#
+# Usage: ./archive.sh
+
+
+git_clone() {
+    git clone "$1" "$2" > /dev/null
+    cwd=`pwd`
+    cd "$2" && git remote rm origin && git gc && cd "$cwd"
+}
+
+git_clone . tmp/dotfiles
+for name in browser shell vcs vim x11; do
+    echo cloning $name to tmp/
+    git_clone $name tmp/dotfiles/$name
+done
+
+echo creating dotfiles.tar
+tar cf tmp/dotfiles.tar -C tmp dotfiles
+echo moving dotfiles.tar to .
+mv tmp/dotfiles.tar .
+
+rm -rf tmp