nsbin/historic_interest_only/backup-script
Nico Schottelius df2daf524d init
Signed-off-by: Nico Schottelius <nico@manager.schottelius.org>
2017-07-19 17:15:41 +02:00

44 lines
1.3 KiB
Bash

#!/bin/sh
#
# 2003-2015 Nico Schottelius (nico-nsbin at schottelius.org)
#
# This file is part of nsbin.
#
# nsbin 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 3 of the License, or
# (at your option) any later version.
#
# nsbin 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 nsbin. If not, see <http://www.gnu.org/licenses/>.
#
#
# Copy / to some other place
#
HOST=fs2
NEWROOT=/mnt/data/spezial/edv/backup/nico
DATA_DIRS="bin boot etc home lib opt root sbin tmp usr var"
#SCRIPTS="/root/scripts/to_eiche"
# display how long we backup
#for script in $SCRIPTS; do
# $script
#done
# create empty dirs
#ssh $HOST "mkdir -p $NEWROOT/dev $NEWROOT/proc $NEWROOT/mnt ; for a in /mnt/*; do mkdir -p $NEWROOT/$a; done"
#date
cd /
# wdt-old
#ssh $HOST "mkdir -p $NEWROOT/`date +%d-%b-%Y`"
#tar cf - $DATA_DIRS | ssh $HOST "( cd $NEWROOT/`date +%d-%b-%Y`; tar xf - )"
time tar cf - $DATA_DIRS | ssh $HOST "gzip -c > $NEWROOT/`date +%d-%b-%Y`.tar.gz "