From: Simon Ruderich Date: Sun, 7 Mar 2010 15:15:07 +0000 (+0100) Subject: archive.sh: Add, creates an archive of important files. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=c9709be14cb6f88c5c8c41b26c805d0acfd4d45b;p=config%2Fdotfiles.git archive.sh: Add, creates an archive of important files. --- 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