#!/bin/sh
# Filename: backup.ftp.full.sh
# Does a complete backup of a system, streaming the afio 
#   archive via ftp to the remote host.

# Copyright (c) 1997 by Ryan Kirkpatrick (rkirkpat@nag.cs.colorado.edu). 
#   All rights reserved.
#
# 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; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# 

# To use, replace {local hostname} with the local hostname of the system
#   and {remote hostname} with the remote hostname.

name={local hostname}

ts=`date +%m%d%Y`

cp /root/.netrc /root/.netrc.org
cat /root/.netrc.backup | sed "s/MACH_NAME/${name}/" >  /root/.netrc.tmp
cat  /root/.netrc.tmp | sed "s/TS/${ts}/" >  /root/.netrc
rm  /root/.netrc.tmp

/usr/bin/find / -xdev -print > /tmp/list.full.${ts}

echo ""
echo ""
cat /tmp/list.full.${ts} | /usr/bin/afio -oz - | ftp {remote hostname}

/bin/rm /tmp/list.full.${ts}
mv /root/.netrc.org /root/.netrc

#EOF
