snappy-rsync 389 Bytes
Newer Older
1 2 3 4
#!/bin/bash

RSYNC=rsync
BACKUPHOST=$1
5
THISHOST=`hostname -s`
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
LOCALDIR=$2/
REMOTEDIR=/backup/$THISHOST/

if ! [ ${1:+1} ]
then
    echo "ERROR: Need host"
    exit 1;
fi


if ! [ ${2:+1} ]
then
    echo "ERROR: Need local path"
    exit 1;
fi

22
$RSYNC --exclude-from=$LOCALDIR/.rsync-excludes -avzhe ssh --delete $LOCALDIR $BACKUPHOST:$REMOTEDIR && ssh $BACKUPHOST snappy snapzfs $THISHOST