#!/bin/bash
backup_directory=/Volumes/100-USERS/pbourguignon/backups
mkdir -p "$backup_directory"/{lion,data}
log=/tmp/backup-$(date +%Y%m%dT%H%M%S)
rmerge='rsync -HSWacvxz -e ssh '
rsynch='rsync -HSWacvxz -e ssh --force --delete --delete-after'
(
    if [ -w $backup_directory ] ; then
        $rsynch --log-file=${log}.log ~/ "$backup_directory/lion"
        $rsynch --log-file=${log}.log /Volumes/data/pbourguignon/{bin,directories,emacs,quicklisp,rc,src/{mercurial-tests,emacs,lisp,ocmock-informatimago,ocmock-1.77*,winids,Makefile,notes.txt,load-cucumber.rb,OpticsProMac-shadow}}  "$backup_directory/data/"
    else
        echo "Please mount 100-USERS."
        exit 1
    fi
) > ${log}.err 2>&1
ViewGit