+BACKUPDIR=/afs/megacz.com/private/hcoop-backup
+BACKUPTMP=/var/backups/hcoop-backup
+SUBDIR=`date +%Y.%m.%d`
+
+#SYNC_CMD="rsync --bwlimit=$BWLIMIT --remove-source-files"
+
+function copy_over () {
+ # Move file to its offsite destination
+ # $1: file, $2: relative directory (optional)
+ if test -z "$1" || test -n "$3"; then
+ echo "Bad programming"
+ exit 1
+ fi
+ local FILE=$1
+ local DEST=$BACKUPDIR/$SUBDIR
+ if test -n "$2"; then
+ DEST=$DEST/$2
+ fi
+ cat $FILE | catsync -b $BWLIMIT $DEST/$FILE
+ rm -f $FILE
+}