From 614d68fab0b6e8c4d58781144fa2a2c871fafaeb Mon Sep 17 00:00:00 2001 From: mwolson_admin Date: Mon, 1 Sep 2008 22:12:07 -0400 Subject: [PATCH] Initial attempt at rsync.net backup solution. --- hcoop-backup | 8 ++++++-- hcoop-backup-wrapper | 4 ++-- rsync.net-move-over | 20 ++++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100755 rsync.net-move-over 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 $@ -- 2.20.1