X-Git-Url: https://www.hackdaworld.org/gitweb/?a=blobdiff_plain;f=backup.sh;h=57cb9e39e5a1faeff74e6f36244a9d35163413b2;hb=82b142aa2d3c809bde0bfdf003890aa0097b232d;hp=857dcae175a83ec24cd011f8642fe002391fd302;hpb=8727fb3de34a33d5955b17c43b09e534e49d4e47;p=scripts%2Fscripts.git diff --git a/backup.sh b/backup.sh index 857dcae..57cb9e3 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 @@ -77,14 +78,14 @@ 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 mkdir ./etc -for i in init.d conf opt ppp cups; do +for i in init.d conf opt ppp cups udev cron.d; do if [ -d /etc/$i ] ; then echo "copying /etc/$i" cp -r /etc/$i ./etc @@ -93,7 +94,8 @@ 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 \ + modprobe.devfs modprobe.conf devfsd.conf crontab; do if [ -f /etc/$i ] ; then echo "copying /etc/$i" cp /etc/$i ./etc @@ -105,6 +107,11 @@ if [ -f /etc/X11/XF86Config ] ; then echo "copying /etc/X11/XF86Config*" cp /etc/X11/XF86Config* ./etc/X11 fi +if [ -f /etc/X11/xorg.conf ] ; then + mkdir -p ./etc/X11 + echo "copying /etc/X11/xorg.conf*" + cp /etc/X11/xorg.conf* ./etc/X11 +fi # specific config stuff @@ -118,12 +125,37 @@ if [ "$host" = "gate" ] ; then cp -r /etc/mail ./etc fi + # mlsit procmail + if [ -d /home/mlist ] ; then + echo "copying mlist procmail config" + cp -r /home/mlist mlsit_pm_config + fi + # irc stuff mkdir -p ./ircd [ -f /etc/opt/unrealircd/unrealircd.conf ] && \ cp /etc/opt/unrealircd/unrealircd.conf ./ircd + + # minimalist stuff + mkdir -p ./minimalist + [ -f /etc/opt/minimalist/minimalist.conf ] && \ + cp /etc/opt/minimalist/minimalist.conf ./minimalist fi +# right-hand specific config stuff +if [ "$host" = "right-hand" ] ; then + if [ -d /var/named ] ; then + mkdir ./named + echo "copying dns data" + cp -r /var/named/* ./named + fi + if [ -f /etc/opt/apache*/httpd.conf ] ; then + mkdir ./apache + cp /etc/opt/apache*/httpd.conf ./apache + fi +fi + + # data stuff echo "data stuff:" @@ -153,38 +185,41 @@ if [ "$host" = "right-hand" ] ; then 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 - echo "copying home" - for i in software store; do + echo -n "copying home ..." + for i in temp test; do + echo -n " $i," [ -d /home/hackbard/$i ] && \ cp -r /home/hackbard/$i ./home/hackbard done - if [ "$host" = "hackstation" ]; then - [ -d /home/hackbard/projects ] && \ - cp -r /home/hackbard/projects ./home/hackbard - fi for i in xinitrc_evil xinitrc_wm .xinitrc GNUstep .Xauthority \ - .Xdefaults .signature .directfbrc; do - [ -f /home/hackbard/$i ] && \ + .Xdefaults .XHkeys .signature .directfbrc .bashrc \ + sp12 .licq .irssi; do + echo -n " $i," + [ -e /home/hackbard/$i ] && \ cp -r /home/hackbard/$i ./home/hackbard done + [ -d /home/hackbard/.mozilla ] && + cp /home/hackbard/.mozilla/*/*/bookmarks.html \ + mozilla-bookmarks.html [ -d /home/hackbard/.ssh ] && cp -r /home/hackbard/.ssh ./home/hackbard + echo " done." # tftpboot if [ -d /tftpboot ] ; then mkdir -p ./tftpboot - echo "copyinf tftpboot stuff" + echo "copying tftpboot stuff" cp -r /tftpboot/* ./tftpboot fi - # hunz config - for i in prism lucent; do - if [ -f /root/hunz_${i}.sh ]; then + # wlan configs + for i in hunz_prism hunz_lucent roman_orinoco.sh; do + if [ -f /root/${i}.sh ]; then mkdir -p ./root - cp /root/hunz_${i}.sh ./root + cp /root/${i}.sh ./root fi done