3 # Copyright (C) 2000-2015 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
8 # Run a simple backup of the Bacula build directory then copy it
11 # This script uses the virtual disk autochanger
13 TestName="copy-job-test"
19 scripts/copy-migration-confs
20 scripts/prepare-disk-changer
21 echo "${cwd}/build" >${cwd}/tmp/file-list
22 sed 's/migrate/copy/g' ${cwd}/bin/bacula-dir.conf > ${cwd}/tmp/1
23 sed 's/Migrate/Copy/g' ${cwd}/tmp/1 > ${cwd}/bin/bacula-dir.conf
26 change_jobname NightlySave $JobName
30 # Note, we first backup into Pool Default,
31 # then Copy into Pool Full.
32 # Pool Default uses Storage=File
33 # Pool Full uses Storage=DiskChanger
35 # Write out bconsole commands
36 cat <<END_OF_DATA >${cwd}/tmp/bconcmds
39 @$out ${cwd}/tmp/log1.out
40 @# setdebug level=100 storage=File
41 label storage=File volume=FileVolume001 Pool=Default
42 label storage=DiskChanger volume=ChangerVolume001 slot=1 Pool=Full drive=0
43 label storage=DiskChanger volume=ChangerVolume002 slot=2 Pool=Full drive=0
44 @# run two jobs (both will be copied)
51 @#setdebug level=100 dir
52 @# should copy two jobs
53 @#setdebug level=51 storage=DiskChanger
54 @#setdebug level=100 storage=File tags=dedup,asx,network options=h
58 @#purge volume=FileVolume001
63 @$out ${cwd}/tmp/log3.out
65 @# Now do another backup, but level Incremental
67 run job=$JobName level=Incremental yes
71 @# This final job that runs should be Incremental and
72 @# not upgraded to full.
77 @$out ${cwd}/tmp/log2.out
79 @#setdebug level=15 director
80 @#setdebug level=150 storage=DiskChanger
81 @# Note, here we are restoring from the original backup,
82 @# so if you specify storage=DiskChanger the restore will fail
83 restore where=${cwd}/tmp/bacula-restores select
95 check_for_zombie_jobs storage=File
101 grep 'Backup Level:' tmp/log3.out | grep Incremental > /dev/null
104 print_debug "The incremental job must use copied jobs"