From c9709be14cb6f88c5c8c41b26c805d0acfd4d45b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 7 Mar 2010 16:15:07 +0100 Subject: [PATCH] archive.sh: Add, creates an archive of important files. --- archive.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 archive.sh diff --git a/archive.sh b/archive.sh new file mode 100755 index 0000000..4a205a2 --- /dev/null +++ b/archive.sh @@ -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 -- 2.43.2