#!/bin/bash
# 
# rsync-backup.sh       rsync local backup directories to a remote place
#
# Copyright (C) 2008 Michael Davies <michael@the-davies.net>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#

# User-definable things
BACKUP_USER=jrhacker
BACKUP_MACHINE=example.com
BACKUP_REMOTE_DIR=/home/jrhacker/backup/
THIS_MACHINE_NAME=mylaptop

# Non-User-definable things
SPACE=" "

while read FILE; do  
    if ! test x${FILE} = x""; then
        #echo ${FILE}
        FILELIST=${FILELIST}${FILE}${SPACE}
    fi
done < ${HOME}/.rsync-backup-files

rsync -avz -e ssh ${FILELIST} ${BACKUP_USER}@${BACKUP_MACHINE}:${BACKUP_REMOTE_DIR}${THIS_MACHINE_NAME}/

# This file has been zigned!  See http://michaeldavies.org/zign-tools
# zign-version: 0.9.4
# zign-hashes: MD5, SHA-1
# -----BEGIN PGP SIGNED MESSAGE-----
# Hash: SHA1
# 
# aae94e7551afb004a016f51e21b8a682a1db8a342f85287401e8b27cc1c938cfd8572273
# -----BEGIN PGP SIGNATURE-----
# Version: GnuPG v1.4.7 (Darwin)
# 
# iD8DBQFHqmbI7kkvCQqp1vwRArIwAJ9AXPTTsp2QGVW0yF6hlLYVV9JLVACgmMhM
# 2Nk6IY4ZptVTobPj2z9RsaQ=
# =bbkG
# -----END PGP SIGNATURE-----
# zign: Protecting you since 2007 :-)
# 