1#!/bin/sh 2# 3# Run a simple backup using the compressed option 4# then restore it. 5# 6 7TestName="restore-replace-never" 8JobName=restore-replace-never 9. scripts/functions 10 11scripts/cleanup 12scripts/copy-test-confs 13mkdir -p ${cwd}/tmp/dir/dir1 14touch ${cwd}/tmp/dir/dir1/file1 15touch ${cwd}/tmp/dir/dir1/file2 16echo ${cwd}/tmp/dir >${cwd}/tmp/file-list 17 18stat ${cwd}/tmp/dir >${cwd}/tmp/1 19stat ${cwd}/tmp/dir/dir1 >>${cwd}/tmp/1 20stat ${cwd}/tmp/dir/dir1/file1 >>${cwd}/tmp/1 21stat ${cwd}/tmp/dir/dir1/file2 >>${cwd}/tmp/1 22# Strip Change: lines 23grep -v "Change:" ${cwd}/tmp/1 >${cwd}/tmp/stat-before 24 25change_jobname CompressedTest $JobName 26start_test 27 28cat <<END_OF_DATA >${cwd}/tmp/bconcmds 29@$out /dev/null 30messages 31@$out ${cwd}/tmp/log1.out 32label storage=File volume=TestVolume001 33run job=$JobName yes 34wait 35messages 36quit 37END_OF_DATA 38 39run_bareos 40 41rm -rf ${cwd}/tmp/dir 42 43cat <<END_OF_DATA >${cwd}/tmp/bconcmds 44@$out /dev/null 45messages 46@$out ${cwd}/tmp/log2.out 47restore where=/ storage=File replace=never select all done yes 48@#restore where=/ storage=File select all done yes 49wait 50messages 51quit 52END_OF_DATA 53 54run_bconsole 55 56stat ${cwd}/tmp/dir >${cwd}/tmp/1 57stat ${cwd}/tmp/dir/dir1 >>${cwd}/tmp/1 58stat ${cwd}/tmp/dir/dir1/file1 >>${cwd}/tmp/1 59stat ${cwd}/tmp/dir/dir1/file2 >>${cwd}/tmp/1 60# Strip Change: lines 61grep -v "Change:" ${cwd}/tmp/1 >${cwd}/tmp/stat-after 62 63check_for_zombie_jobs storage=File 64stop_bareos 65 66check_two_logs 67if test "$debug" -eq 1 ; then 68 diff -u ${cwd}/tmp/stat-before ${cwd}/tmp/stat-after 69else 70 diff -u ${cwd}/tmp/stat-before ${cwd}/tmp/stat-after 2>&1 >/dev/null 71fi 72if [ $? != 0 ]; then 73 dstat=1 74fi 75end_test 76