X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=backup.sh;h=ebf8c16a46aba415d5a5f764a145a3b8d42fcccd;hb=026d55d4612eea2a125797446e6e478ab592f3d1;hp=d7bce9a36bc064a0065b292cb8fc5626914ad269;hpb=9510447e56f49f8495b0328b56beacafe1f25074;p=scripts%2Fscripts.git diff --git a/backup.sh b/backup.sh index d7bce9a..ebf8c16 100755 --- a/backup.sh +++ b/backup.sh @@ -5,6 +5,7 @@ backup_date=`date | awk '{ print $3"."$2"."$6 }'` host=`hostname` +[ ! -d /mnt/nfs ] && mkdir -p /mnt/nfs # set the backup directory if [ "$host" = "gate" ] ; then @@ -24,7 +25,7 @@ elif [ "$host" = "hackstation" ] ; then elif [ "$host" = "hdw" ] ; then mount -tnfs hackstation:/mnt/lfs/backup /mnt/nfs backup_dir="/mnt/nfs" -elif [ "$host" = "left-hand" ] ; then +elif [ "$host" = "compaq" ] ; then mount -tnfs hackstation:/mnt/lfs/backup /mnt/nfs backup_dir="/mnt/nfs" else @@ -77,9 +78,9 @@ echo "config stuff:" mkdir ./${host}-conf && cd ./${host}-conf for i in $kernel_num; do - if [ -f /usr/src/linux-${i}*/.config ] ; then + if [ -f /usr/src/linux-${i}/.config ] ; then echo "copying /usr/src/linux/.config" - cp /usr/src/linux-${i}*/.config ./$host-kernel-${i}-config + cp /usr/src/linux-${i}/.config ./$host-kernel-${i}-config fi done @@ -93,7 +94,7 @@ done for i in dhcpd.conf fstab hosts host.conf hosts.allow hosts.deny lilo.conf \ profile sendmail.cf resolv.conf exports fb.modes inetd.conf \ - xinetd.conf mp3user mp3db.conf; do + xinetd.conf mp3user mp3db.conf modules.conf named.conf; do if [ -f /etc/$i ] ; then echo "copying /etc/$i" cp /etc/$i ./etc @@ -147,13 +148,19 @@ if [ "$host" = "right-hand" ] ; then for i in www cvs hdw; do if [ -d /chroot/$i ] ; then echo "copying /chroot/$i" - tar .cf ./chroot/$i.tar /chroot/$i + tar -cf ./chroot/$i.tar /chroot/$i fi done + + mkdir ./named + if [ -d /var/named ] ; then + echo "copying dns data" + cp -r /var/named/* ./named + fi fi # hackstation / mobile / hdw / sparc specific data -if [ "$host" = "hackstation" -o "$host" = "mobile" -o "$host" = "hdw" -o "$host" = "sparc" -o "$host" = "left-hand" ] ; then +if [ "$host" = "hackstation" -o "$host" = "mobile" -o "$host" = "hdw" -o "$host" = "sparc" -o "$host" = "compaq" ] ; then # home of hackbard mkdir -p ./home/hackbard @@ -167,7 +174,7 @@ if [ "$host" = "hackstation" -o "$host" = "mobile" -o "$host" = "hdw" -o "$host" cp -r /home/hackbard/projects ./home/hackbard fi for i in xinitrc_evil xinitrc_wm .xinitrc GNUstep .Xauthority \ - .Xdefaults .signature .directfbrc; do + .Xdefaults .signature .directfbrc .bashrc; do [ -f /home/hackbard/$i ] && \ cp -r /home/hackbard/$i ./home/hackbard done