#!/bin/sh
#
# Rubi's Ultimate Backup Implementation
#
# Version 4.0, (C) 3.1999 by Beat Rubischon <beat@rubis.ch>
#                  8.1999 by Beat Rubischon <beat.rubischon@trivadis.com>
#                  2.2000 by Beat Rubischon <beat@rubis.ch>
#                  2.2004 by Beat Rubischon <rubischon@phys.ethz.ch>
#                  7.2007 by Beat Rubischon <beat@0x1b.ch>
#                 10.2010 by Beat Rubischon <beat.rubischon@dalco.ch>
#                 12.2015 by Beat Rubischon <beat.rubischon@dalco.ch>
#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: rubi-sample,v 1.5 2015/12/01 14:46:00 beat Exp $
#
# Configuration and main routine in one :-)

# ---------------
# Global settings
# ---------------
PREFIX=/opt/rubi				# sitewide home of rubi

FIND=/usr/bin/find				# local GNU find
RSYNC=/usr/bin/rsync				# path of a recent rsync

# ----------------------
# Source shell functions
# ----------------------
. $PREFIX/lib/functions.sh

# ------
# Backup of max
# ------
SRCHOST=localhost				# source host
SRCPART="/ /boot /export /export/home /export/data /opt/cms"	# source partitions
BASEDST=/backup/max				# base backup dir
DSTDIR=$BASEDST/`date +%Y.%m.%d-%H:%M`		# destination
OLDDST="`cat $BASEDST/lastdst 2>/dev/null`"	# last destination
KEEPG=15					# successful backups to keep
KEEPD=15					# min age before delete

doit | tee $DSTDIR.log

# ------
# Backup of rt-1
# ------
SRCHOST=rt-1					# source host
SRCPART="/"					# source partitions
BASEDST=/backup/rt-1				# base backup dir
DSTDIR=$BASEDST/`date +%Y.%m.%d-%H:%M`		# destination
OLDDST="`cat $BASEDST/lastdst 2>/dev/null`"	# last destination
KEEPG=15					# successful backups to keep
KEEPD=15					# min age before delete

doit | tee $DSTDIR.log
