1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
#! /usr/bin/env bash
# Copyright © 2011, 2012, 2014 Richard Kettlewell.
#
# 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 3 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, see <http://www.gnu.org/licenses/>.
set -e
. ${srcdir:-.}/setup.sh
setup
export EXPECT_STATUS=ok
echo "| --dry-run should do nothing"
RUN=dryrun RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --dry-run --backup --text ${WORKSPACE}/got/15.txt --html ${WORKSPACE}/got/15.html host1:volume1
exists ${WORKSPACE}/dryrun-dev-pre.ran
exists ${WORKSPACE}/dryrun-dev-post.ran
absent ${WORKSPACE}/dryrun-dev-pre.acted
absent ${WORKSPACE}/dryrun-dev-post.acted
#exists dryrun-pre.ran
#exists dryrun-post.ran
absent ${WORKSPACE}/dryrun-pre.acted
absent ${WORKSPACE}/dryrun-post.acted
absent ${WORKSPACE}/store1/host1/volume1/1980-01-01
absent ${WORKSPACE}/store1/host1/volume2
absent ${WORKSPACE}/store2/host1
compare ${srcdir:-.}/expect/15.txt ${WORKSPACE}/got/15.txt
compare ${srcdir:-.}/expect/15.html ${WORKSPACE}/got/15.html
echo "| Create backup for one volume"
RUN=volume1 RSBACKUP_TODAY=1980-01-01 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/16.txt --html ${WORKSPACE}/got/16.html host1:volume1
exists ${WORKSPACE}/volume1-dev-pre.ran
exists ${WORKSPACE}/volume1-dev-post.ran
exists ${WORKSPACE}/volume1-dev-pre.ran
exists ${WORKSPACE}/volume1-dev-post.ran
exists ${WORKSPACE}/volume1-pre.acted
exists ${WORKSPACE}/volume1-post.acted
exists ${WORKSPACE}/volume1-pre.acted
exists ${WORKSPACE}/volume1-post.acted
compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-01
absent ${WORKSPACE}/store1/host1/volume2
absent ${WORKSPACE}/store1/host1/volume3
absent ${WORKSPACE}/store2/host1/volume2
absent ${WORKSPACE}/store2/host1/volume3
compare ${srcdir:-.}/expect/16.txt ${WORKSPACE}/got/16.txt
compare ${srcdir:-.}/expect/16.html ${WORKSPACE}/got/16.html
echo "| Create backup for one host"
RUN=host1 RSBACKUP_TODAY=1980-01-02 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/17.txt --html ${WORKSPACE}/got/17.html host1
exists ${WORKSPACE}/host1-pre.acted
exists ${WORKSPACE}/host1-post.acted
compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-02
compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-02
absent ${WORKSPACE}/store1/host1/volume3
compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-02
compare ${srcdir:-.}/expect/17.txt ${WORKSPACE}/got/17.txt
compare ${srcdir:-.}/expect/17.html ${WORKSPACE}/got/17.html
echo "| Create backup for everything"
RUN=all RSBACKUP_TODAY=1980-01-03 s ${RSBACKUP} --backup --text ${WORKSPACE}/got/18.txt --html ${WORKSPACE}/got/18.html
exists ${WORKSPACE}/all-pre.acted
exists ${WORKSPACE}/all-post.acted
compare ${WORKSPACE}/volume1 ${WORKSPACE}/store1/host1/volume1/1980-01-03
compare ${WORKSPACE}/volume2 ${WORKSPACE}/store1/host1/volume2/1980-01-03
absent ${WORKSPACE}/store1/host1/volume3
compare ${WORKSPACE}/volume3 ${WORKSPACE}/store2/host1/volume3/1980-01-03
compare ${srcdir:-.}/expect/18.txt ${WORKSPACE}/got/18.txt
compare ${srcdir:-.}/expect/18.html ${WORKSPACE}/got/18.html
cleanup
|