#!/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 then migrate it
# to another device.
JobName=MigrationJobSpanSave
. scripts/functions
-. config.out
scripts/cleanup
scripts/copy-migration-confs
-scripts/prepare-two-disks
-echo "${cwd}/build" >/tmp/file-list
+scripts/prepare-disk-changer
+echo "${cwd}/build" >${cwd}/tmp/file-list
cp ${cwd}/bin/bacula-sd.conf ${cwd}/tmp/1
sed "s%# Maximum File Size% Maximum File Size%" ${cwd}/tmp/1 >${cwd}/bin/bacula-sd.conf
# Pool Full uses Storage=DiskChanger
# Write out bconsole commands
-cat <<END_OF_DATA >tmp/bconcmds
-@output
+cat <<END_OF_DATA >${cwd}/tmp/bconcmds
+@output /dev/null
messages
-@$out tmp/log1.out
+@$out ${cwd}/tmp/log1.out
@#setdebug level=10 dir
@#setdebug level=100 storage=File
label storage=File volume=FileVolume001 Pool=Default
@#
@# now do a restore
@#
-@$out tmp/log2.out
+@$out ${cwd}/tmp/log2.out
+setdebug level=500 storage=File
restore where=${cwd}/tmp/bacula-restores select storage=DiskChanger
unmark *
mark *
yes
wait
messages
-@output
quit
END_OF_DATA