#!/bin/sh

export PATH=$PATH:/bin:/usr/bin:/usr/local/bin:/sbin

# directory to backup
BDIR=/home/olpc/

# excludes file - this contains a wildcard pattern per line of files to exclude
EXCLUDES=/etc/backup_excludes

# the name of the backup machine
BSERVER=192.168.0.1

DIRNAME=`/sbin/ifconfig -a | grep 'HWaddr' | head -1 | awk '{ print $5 }'`;

# your password on the backup server
#export RSYNC_PASSWORD=vai_will


########################################################################

BACKUPDIR=$BDIR/backup/$DIRNAME

OPTS="--force --ignore-errors --exclude-from=$EXCLUDES 
      --delete -a"

# now the actual transfer
rsync $OPTS $BDIR $BSERVER::olpc/$DIRNAME

exit 0
