]> hackdaworld.org Git - scripts/scripts.git/commitdiff
added create_daily_cvs_snapshot.sh, readded backup_win.sh 750
authorhackbard <hackbard>
Thu, 6 Jan 2005 21:31:39 +0000 (21:31 +0000)
committerhackbard <hackbard>
Thu, 6 Jan 2005 21:31:39 +0000 (21:31 +0000)
README
backup_win.sh [new file with mode: 0755]
create_daily_cvs_snapshot.sh [new file with mode: 0755]

diff --git a/README b/README
index 80a2c7943bb476decdeb6f1e242e26221d338208..aef6cd1daceb961fb93170f75b33c42532c1f07b 100644 (file)
--- a/README
+++ b/README
@@ -24,4 +24,7 @@
 - wakeup.sh
   wake up hosts by hostname using etherwake & /etc/ethers file
 
+- create_daily_cvs_snapshot
+  creates a daily cvs snapshot
+
 EOF
diff --git a/backup_win.sh b/backup_win.sh
new file mode 100755 (executable)
index 0000000..53ee0d6
--- /dev/null
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# small backup script for maiks wondoof stuff ... definetly pr0n!
+# please check carefully! DATALOSS POSSIBLE :)
+
+# edit this variables @ maik
+SERVICES="//arbeitsplatz/foo //arbeitsplatz/bar"
+BACKUPDIR="/backup"
+USER="maik"
+PASSWORD="mausschubser"
+
+# do no longer edit the following variables :)
+MOUNT="mount -t smbfs"
+MOUNTOPT="-o username=$USER,password=$PASSWORD"
+
+# kernel must understand smbfs
+modprobe smbfs > /dev/null 2>&1
+
+for service in $SERVICES; do
+       mntpt=`echo $service | awk -F/ '{ print $4 }'`
+       mkdir -p /tmp/$mntpt
+       $MOUNT $service /tmp/$mntpt $MOUNTOPT
+       echo
+       echo "backuping files from $service to $BACKUPDIR ..."
+       echo
+       rsync -avz /tmp/$mntpt $BACKUPDIR
+       OK=0
+       umount /tmp/$mntpt && OK=1
+       if [ "$OK" = "1" ] ; then
+               rm -rf /tmp/$mntpt
+       else
+               echo "umount failed, not delelting mountpoint $mntpt..."
+       fi
+done
diff --git a/create_daily_cvs_snapshot.sh b/create_daily_cvs_snapshot.sh
new file mode 100755 (executable)
index 0000000..64f66bb
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+echo -en "creating cvs hdw-linux-cvs snapshot ...\n" >> /var/log/messages
+touch ~/.cvspass
+mkdir -p /tmp/hdw ; cd /tmp/hdw
+cvs -d:pserver:anonymous@cvs.hackdaworld.dyndns.org:/hdw-linux co hdw-linux
+cd hdw-linux
+for i in `find ./ -name CVS`; do
+       rm -rf $i
+done
+cd ..
+mv hdw-linux hdw-linux-cvs
+tar cf hdw-linux-cvs.tar hdw-linux-cvs
+bzip2 hdw-linux-cvs.tar
+mv hdw-linux-cvs.tar.bz2 /chroot/www/htdocs/download/hdw-linux/hdw-linux-cvs/snapshot/
+cd ..
+rm -rf hdw
+echo -en " done\n" >> /var/log/messages