From: mwolson_admin Date: Tue, 2 Sep 2008 02:12:07 +0000 (-0400) Subject: Initial attempt at rsync.net backup solution. X-Git-Url: http://git.hcoop.net/clinton/scripts.git/commitdiff_plain/614d68fab0b6e8c4d58781144fa2a2c871fafaeb?hp=0f358f5cb4424db10b7adf4668b285eadb91e673 Initial attempt at rsync.net backup solution. --- diff --git a/hcoop-backup b/hcoop-backup index 5340f8e..2b26d80 100755 --- a/hcoop-backup +++ b/hcoop-backup @@ -19,12 +19,16 @@ KEYFILE=/etc/backup-encryption-key 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' -#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 diff --git a/hcoop-backup-wrapper b/hcoop-backup-wrapper index fd51cfa..8350dfa 100755 --- a/hcoop-backup-wrapper +++ b/hcoop-backup-wrapper @@ -1,10 +1,10 @@ #!/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 -LOG=/var/log/backup-to-s3-log +LOG=/var/log/backup-to-rsync-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 index 0000000..74d3cf6 --- /dev/null +++ b/rsync.net-move-over @@ -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 $@