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
#!/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
--- /dev/null
+#!/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 $@