Initial attempt at rsync.net backup solution.
authormwolson_admin <mwolson_admin@deleuze.hcoop.net>
Tue, 2 Sep 2008 02:12:07 +0000 (22:12 -0400)
committermwolson_admin <mwolson_admin@deleuze.hcoop.net>
Tue, 2 Sep 2008 02:12:07 +0000 (22:12 -0400)
hcoop-backup
hcoop-backup-wrapper
rsync.net-move-over [new file with mode: 0755]

index 5340f8e..2b26d80 100755 (executable)
@@ -19,12 +19,16 @@ KEYFILE=/etc/backup-encryption-key
 BACKUPTMP=/var/backups/hcoop-backup
 CURDATE=$(date +%Y.%m.%d)
 
 BACKUPTMP=/var/backups/hcoop-backup
 CURDATE=$(date +%Y.%m.%d)
 
-MOVE_OVER=$(dirname $0)/s3-move
+MOVE_OVER=$(dirname $0)/rsync.net-move-over
 
 IFS=$'\n'
 
 
 IFS=$'\n'
 
-#prune_old_backups
+# Initialize storage area
+RSYNCDIR=/vicepa/hcoop-backups/files
+rm -fr $RSYNCDIR
+mkdir -p $RSYNCDIR/$CURDATE
 
 
+# Initialize backup staging area
 mkdir -p $BACKUPTMP
 cd $BACKUPTMP
 
 mkdir -p $BACKUPTMP
 cd $BACKUPTMP
 
index fd51cfa..8350dfa 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/bash
 
 #!/bin/bash
 
-exec >& /var/log/backup-to-s3-wrapper-log
+exec >& /var/log/backup-to-rsync-wrapper-log
 touch /xyz/zys   # generate an error message
 
 fs checkvol
 touch /xyz/zys   # generate an error message
 
 fs checkvol
-LOG=/var/log/backup-to-s3-log
+LOG=/var/log/backup-to-rsync-log
 rm -f $LOG
 echo "groups before k5start" > $LOG
 groups >> $LOG
 rm -f $LOG
 echo "groups before k5start" > $LOG
 groups >> $LOG
diff --git a/rsync.net-move-over b/rsync.net-move-over
new file mode 100755 (executable)
index 0000000..74d3cf6
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+BACKUPDIR=/vicepa/hcoop-backups/files
+
+function move_over () {
+    # Move file to its final destination.
+    # Expects the file to come from STDIN.
+    # $1: date subdirectory
+    # $2: filename
+    if test -z "$2" || test -n "$3"; then
+        echo >&2 "Bad programming"
+        exit 1
+    fi
+    local subdir=$1
+    local file=$2
+    local dest=$BACKUPDIR/$subdir/$file
+    tee $dest > /dev/null
+}
+
+move_over $@