configure.ac: Don't let the LIBS setting leak out.
[distorted-backup] / bkp.dump.in
CommitLineData
99248ed2
MW
1#! /bin/sh
2### -*-sh-*-
3###
4### Backup ext[2-4] filesystem using dump
5###
6### (c) 2011 Mark Wooding
7###
8
9###----- Licensing notice ---------------------------------------------------
10###
13678d88
MW
11### This file is part of the distorted.org.uk backup suite.
12###
13### distorted-backup is free software; you can redistribute it and/or modify
99248ed2
MW
14### it under the terms of the GNU General Public License as published by
15### the Free Software Foundation; either version 2 of the License, or
16### (at your option) any later version.
17###
13678d88 18### distorted-backup is distributed in the hope that it will be useful,
99248ed2
MW
19### but WITHOUT ANY WARRANTY; without even the implied warranty of
20### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21### GNU General Public License for more details.
22###
13678d88
MW
23### You should have received a copy of the GNU General Public License along
24### with distorted-backup; if not, write to the Free Software Foundation,
99248ed2
MW
25### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27set -e
28. @pkglibdir@/bkpfunc.sh
29
30## Check arguments and environment.
31preflight
32case $# in 0 | 1) echo >&2 "usage: $QUIS TAG DEVICE DUMPARGS ..." ;; esac
33tag=$1 device=$2; shift 2
34
35## Transform the date format.
36since=$(datefmt "%a %b %e %H:%M:%S %Y %z" "$BKP_LASTDATE")
37
38## Make a snapshot and dump it.
39snap=$(snap "$device" tag=dump)
40set +e
41run \
42 env RSH=ssh RMT=$BKP_RMT \
43 dump -${BKP_LEVEL}q -z9 -T"$since" \
44 -f"$BKP_HOST:$BKP_ASSET/$tag.dump" -Q"$tag.qfa" \
45 "$@" \
46 "/dev/$snap"
47rc=$?; set -e
48snap -u "$device" tag=dump
49case $rc in 0) ;; *) exit $rc ;; esac
50
51scp "$BKP_HOST:$BKP_TARGET/$tag.dump.hash" "$tag.dump.hash"
52hash=$(cat "$tag.dump.hash")
53ssh "$BKP_HOST" rm "$BKP_TARGET/$tag.dump.hash"
54scp "$tag.qfa" "$BKP_HOST:$BKP_TARGET/$tag.qfa"
55bkpadmin hash "$BKP_ASSET" "$tag.dump" "$hash"
56
57###----- That's all, folks --------------------------------------------------