#!/bin/sh # # Copyright (C) 2000-2015 Kern Sibbald # License: BSD 2-Clause; see file LICENSE-FOSS # # # Run a simple backup of the Bacula build directory using the compressed option # then restore it. # TestName="restore-by-file-test" JobName=restorebyfile . scripts/functions scripts/cleanup scripts/copy-test-confs echo "${cwd}/tmp/build" >${cwd}/tmp/file-list mkdir -p ${cwd}/tmp/build cp -p ${cwd}/build/src/dird/*.c ${cwd}/tmp/build cd ${cwd}/tmp/build ls >../1 cd .. sed s%\^%${cwd}/tmp/build/% 1 | sort | uniq >restore-list rm -f 1 cd ${cwd} change_jobname CompressedTest $JobName start_test cat <${cwd}/tmp/bconcmds @output /dev/null messages @$out ${cwd}/tmp/log1.out label storage=File volume=TestVolume001 run job=$JobName yes wait messages @# @# now run 10 restores @# @$out ${cwd}/tmp/log2.out restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait restore where=${cwd}/tmp/bacula-restores storage=File 7 <${cwd}/tmp/restore-list yes wait messages quit END_OF_DATA run_bacula check_for_zombie_jobs storage=File stop_bacula check_two_logs check_restore_tmp_build_diff end_test