]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - archive.sh
archive.sh: Add, creates an archive of important files.
[config/dotfiles.git] / archive.sh
1 #!/bin/sh
2
3 # Create an archive of my configuration file which can be uploaded on a
4 # server.
5 #
6 # Usage: ./archive.sh
7
8
9 git_clone() {
10     git clone "$1" "$2" > /dev/null
11     cwd=`pwd`
12     cd "$2" && git remote rm origin && git gc && cd "$cwd"
13 }
14
15 git_clone . tmp/dotfiles
16 for name in browser shell vcs vim x11; do
17     echo cloning $name to tmp/
18     git_clone $name tmp/dotfiles/$name
19 done
20
21 echo creating dotfiles.tar
22 tar cf tmp/dotfiles.tar -C tmp dotfiles
23 echo moving dotfiles.tar to .
24 mv tmp/dotfiles.tar .
25
26 rm -rf tmp