rename .cron to .cron-stage as mcron uses .cron
[james-home.git] / bin / aix
blob12e8269be05d16b381eca016e22b79710dbe4c5e
1 #!/bin/sh
2 # tar/untar dotfiles for aix. the aix boxen at $WORK do not have git
3 set -e
4 cd
6 NUMARGS=${#}
7 ARCHIVES=".home.tar .etc.tar"
8 DOTFILES=".dotfiles.tar"
10 usage()
12 printf "Usage: $0 tar|untar archive"
15 if [ $NUMARGS -gt 2 ]; then
16 usage
17 exit 1
19 case "$1" in
20 tar)
21 if [ $NUMARGS -eq 1 ]; then
22 # tar up stuff. These should correspond to the git archive in .mrconfig
23 for archive in $ARCHIVES
25 "$0" $1 $archive
26 if [ $? -ne 0 ]; then
27 printf "Couldn't $1 $archive\n" ; exit 1
29 done
30 gtar cfv $DOTFILES $ARCHIVES
31 else
32 case "$2" in
33 .home.tar)
34 gtar cfv .home.tar bin
37 gtar cfv ${2} --exclude=known --exclude=.git ${2%.tar}
39 esac
43 untar)
44 tar xfv $DOTFILES
45 for archive in $ARCHIVES
47 tar xfv $archive
48 if [ $? -ne 0 ]; then
49 printf "Couldn't untar $archive\n" ;exit 1
51 done
54 *) usage;;
55 esac