#! /bin/sh ### -*-sh-*- ### ### Backup ext[2-4] filesystem using dump ### ### (c) 2011 Mark Wooding ### ###----- Licensing notice --------------------------------------------------- ### ### This file is part of the distorted.org.uk backup suite. ### ### distorted-backup 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. ### ### distorted-backup 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 distorted-backup; if not, write to the Free Software Foundation, ### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. set -e . @pkglibdir@/bkpfunc.sh ## Check arguments and environment. preflight case $# in 0 | 1) echo >&2 "usage: $QUIS TAG DEVICE DUMPARGS ..." ;; esac tag=$1 device=$2; shift 2 ## Transform the date format. since=$(datefmt "%a %b %e %H:%M:%S %Y %z" "$BKP_LASTDATE") ## Make a snapshot and dump it. snap=$(snap "$device" tag=dump) set +e run \ env RSH=ssh RMT=$BKP_RMT \ dump -${BKP_LEVEL}q -z9 -T"$since" \ -f"$BKP_HOST:$BKP_ASSET/$tag.dump" -Q"$tag.qfa" \ "$@" \ "/dev/$snap" rc=$?; set -e snap -u "$device" tag=dump case $rc in 0) ;; *) exit $rc ;; esac scp "$BKP_HOST:$BKP_TARGET/$tag.dump.hash" "$tag.dump.hash" hash=$(cat "$tag.dump.hash") ssh "$BKP_HOST" rm "$BKP_TARGET/$tag.dump.hash" scp "$tag.qfa" "$BKP_HOST:$BKP_TARGET/$tag.qfa" bkpadmin hash "$BKP_ASSET" "$tag.dump" "$hash" ###----- That's all, folks --------------------------------------------------