Technical‎ > ‎

Backup Bouncer

Backup Bouncer is a test designed to see whether a backup program preserves all of the filesystem attributes on HFS+, the filesystem used on Mac OSX.

HashBackup passes Backup Bouncer 100%.  Below are the test results and a script that can be used to reproduce these results.

Backup Bouncer Test Results  May 2016
Run on OSX 10.6.8 (Snow Leopard)

1. Download Backup-Bouncer-master.zip into a directory
2. copy bb.sh (at the end of this file) to this directory
3. sudo sh bb.sh to run the Backup Bouncer test

Results of the test:

+ rm -rf Backup-Bouncer-master
+ unzip Backup-Bouncer-master.zip
Archive:  Backup-Bouncer-master.zip
3bd61f60fa4ac0a876f8721f904aac74d6930b56
   creating: Backup-Bouncer-master/
  inflating: Backup-Bouncer-master/BackupBouncer.kpf 
  inflating: Backup-Bouncer-master/LICENSE.txt 
  inflating: Backup-Bouncer-master/Makefile 
  inflating: Backup-Bouncer-master/README.SNOW_LEOPARD.txt 
  inflating: Backup-Bouncer-master/README.txt 
 extracting: Backup-Bouncer-master/VERSION.txt 
  inflating: Backup-Bouncer-master/autopilot 
  inflating: Backup-Bouncer-master/bbouncer 
   creating: Backup-Bouncer-master/copiers.d/
  inflating: Backup-Bouncer-master/copiers.d/10-rsync-apple.cp 
  inflating: Backup-Bouncer-master/copiers.d/15-rsync-macports.cp 
  inflating: Backup-Bouncer-master/copiers.d/16-rsync-fink.cp 
  inflating: Backup-Bouncer-master/copiers.d/30-cp-apple.cp 
  inflating: Backup-Bouncer-master/copiers.d/40-ditto.cp 
  inflating: Backup-Bouncer-master/copiers.d/50-tar.cp 
  inflating: Backup-Bouncer-master/copiers.d/60-pax.cp 
  inflating: Backup-Bouncer-master/copiers.d/70-xar-apple.cp 
  inflating: Backup-Bouncer-master/copiers.d/75-xar-svn.cp 
   creating: Backup-Bouncer-master/scripts/
  inflating: Backup-Bouncer-master/scripts/test-asr 
   creating: Backup-Bouncer-master/tests.d/
  inflating: Backup-Bouncer-master/tests.d/00-basic-permissions.test 
  inflating: Backup-Bouncer-master/tests.d/05-timestamps.test 
  inflating: Backup-Bouncer-master/tests.d/10-symlinks.test 
  inflating: Backup-Bouncer-master/tests.d/15-symlink-ownership.test 
  inflating: Backup-Bouncer-master/tests.d/20-hardlinks.test 
  inflating: Backup-Bouncer-master/tests.d/25-aliases.test.disabled 
  inflating: Backup-Bouncer-master/tests.d/30-resource-forks.test 
  inflating: Backup-Bouncer-master/tests.d/40-finder-flags.test 
  inflating: Backup-Bouncer-master/tests.d/45-finder-locks.test 
  inflating: Backup-Bouncer-master/tests.d/50-creation-date.test 
  inflating: Backup-Bouncer-master/tests.d/60-bsd-flags.test 
  inflating: Backup-Bouncer-master/tests.d/70-extended-attrs.test 
  inflating: Backup-Bouncer-master/tests.d/80-access-control-lists.test 
  inflating: Backup-Bouncer-master/tests.d/90-fifo.test 
  inflating: Backup-Bouncer-master/tests.d/95-devices.test 
  inflating: Backup-Bouncer-master/tests.d/99-combo-tests.test 
   creating: Backup-Bouncer-master/util/
  inflating: Backup-Bouncer-master/util/Makefile 
  inflating: Backup-Bouncer-master/util/copy-runner 
  inflating: Backup-Bouncer-master/util/hardlink-util.c 
  inflating: Backup-Bouncer-master/util/lsalias 
  inflating: Backup-Bouncer-master/util/make_alias 
  inflating: Backup-Bouncer-master/util/test-runner 
  inflating: Backup-Bouncer-master/util/xattr-util.c 
+ cd Backup-Bouncer-master
+ make
cd util && make
cc -Wall    xattr-util.c   -o xattr-util
xattr-util.c: In function ‘main’:
xattr-util.c:107: warning: unused variable ‘value’
cc -Wall    hardlink-util.c   -o hardlink-util

# NOTE: below, Backup Bouncer is patched to remove the nodump bit.
# HashBackup respects the nodump bit and does not save files, but
# Backup Bouncer expects files with nodump to be saved (bug in BB).
# The patch is shown in the shell script at the end.

+ patch --context -p1
patching file tests.d/60-bsd-flags.test
+ patch --context -p1
patching file tests.d/99-combo-tests.test
+ umount -f /Volumes/bbtest
+ rm -f bbtest.sparseimage
+ ./bbouncer create-vol bbtest
created: /hbtest/Backup-Bouncer-master/bbtest.sparseimage
/dev/disk18        GUID_partition_scheme       
/dev/disk18s1           Apple_HFS                          /Volumes/bbtest
+ ./bbouncer create /Volumes/bbtest
Cleaning: 00-basic-permissions
Cleaning:        05-timestamps
Cleaning:          10-symlinks
Cleaning: 15-symlink-ownership
Cleaning:         20-hardlinks
Cleaning:    30-resource-forks
Cleaning:      40-finder-flags
Cleaning:      45-finder-locks
Cleaning:     50-creation-date
Cleaning:         60-bsd-flags
Cleaning:    70-extended-attrs
Cleaning: 80-access-control-lists
Cleaning:              90-fifo
Cleaning:           95-devices
Cleaning:       99-combo-tests
Creating: 00-basic-permissions ... ok
Creating:        05-timestamps ... ok
Creating:          10-symlinks ... ok
Creating: 15-symlink-ownership ... ok
Creating:         20-hardlinks ... ok
Creating:    30-resource-forks ... ok
Creating:      40-finder-flags ... ok
Creating:      45-finder-locks ... ok
Creating:     50-creation-date ... ok
Creating:         60-bsd-flags ... ok
Creating:    70-extended-attrs ... ok
Creating: 80-access-control-lists ... ok
Creating:              90-fifo ... ok
Creating:           95-devices ... ok
Creating:       99-combo-tests ... ok
+ hb init -c hb
HashBackup build #1521 Copyright 2009-2016 HashBackup, LLC
Backup directory: /hbtest/Backup-Bouncer-master/hb
Permissions set for owner access only
Created key file /hbtest/Backup-Bouncer-master/hb/key.conf
Key file set to read-only
Setting include/exclude defaults: /hbtest/Backup-Bouncer-master/hb/inex.conf

VERY IMPORTANT: your backup is encrypted and can only be accessed with
the encryption key, stored in the file:
    /hbtest/Backup-Bouncer-master/hb/key.conf
You MUST make copies of this file and store them in a secure location,
separate from your computer and backup data.  If your hard drive fails,
you will need this key to restore your files.  If you setup any
remote destinations in dest.conf, that file should be copied too.

Backup directory initialized
+ hb backup -c hb /Volumes/bbtest -v3
HashBackup build #1525 Copyright 2009-2016 HashBackup, LLC
Backup directory: /hbtest/Backup-Bouncer-master/hb
Copied HB program to /hbtest/Backup-Bouncer-master/hb/hb#1525
This is backup version: 0
Dedup is not enabled
/Volumes/bbtest
/Volumes/bbtest/.Trashes
/Volumes/bbtest/.Trashes/501
/Volumes/bbtest/.fseventsd
/Volumes/bbtest/.fseventsd/fseventsd-uuid
/Volumes/bbtest/00-basic-permissions
/Volumes/bbtest/00-basic-permissions/owned-by-me
/Volumes/bbtest/00-basic-permissions/owned-by-root
/Volumes/bbtest/00-basic-permissions/owned-by-www
/Volumes/bbtest/00-basic-permissions/some-dir
/Volumes/bbtest/05-timestamps
/Volumes/bbtest/05-timestamps/some-dir
/Volumes/bbtest/05-timestamps/some-file
/Volumes/bbtest/05-timestamps/some-hardlink
/Volumes/bbtest/10-symlinks
/Volumes/bbtest/10-symlinks/broken_symlink
/Volumes/bbtest/10-symlinks/link2broken_symlink
/Volumes/bbtest/10-symlinks/some-file
/Volumes/bbtest/10-symlinks/symlink1
/Volumes/bbtest/10-symlinks/symlink2
/Volumes/bbtest/10-symlinks/symlink3
/Volumes/bbtest/15-symlink-ownership
/Volumes/bbtest/15-symlink-ownership/some-file
/Volumes/bbtest/15-symlink-ownership/symlink1
/Volumes/bbtest/15-symlink-ownership/symlink2
/Volumes/bbtest/15-symlink-ownership/symlink3
/Volumes/bbtest/20-hardlinks
/Volumes/bbtest/20-hardlinks/link1
/Volumes/bbtest/20-hardlinks/link2
/Volumes/bbtest/20-hardlinks/link3
/Volumes/bbtest/20-hardlinks/some-file
/Volumes/bbtest/30-resource-forks
/Volumes/bbtest/30-resource-forks/hl-rfork1
/Volumes/bbtest/30-resource-forks/hl-rfork2
/Volumes/bbtest/30-resource-forks/some-file
/Volumes/bbtest/40-finder-flags
/Volumes/bbtest/40-finder-flags/bundle-dir
/Volumes/bbtest/40-finder-flags/bundle-dir/stuff
/Volumes/bbtest/40-finder-flags/hidden-extension.txt
/Volumes/bbtest/40-finder-flags/invisible-dir
/Volumes/bbtest/40-finder-flags/mucho-flags-dir
/Volumes/bbtest/40-finder-flags/mucho-flags-file
/Volumes/bbtest/40-finder-flags/system-file
/Volumes/bbtest/40-finder-flags/type-and-creator
/Volumes/bbtest/45-finder-locks
/Volumes/bbtest/45-finder-locks/locked-file
/Volumes/bbtest/50-creation-date
/Volumes/bbtest/50-creation-date/creation-date-test
/Volumes/bbtest/60-bsd-flags
/Volumes/bbtest/60-bsd-flags/dir-with-flags
/Volumes/bbtest/60-bsd-flags/file-with-flags
/Volumes/bbtest/70-extended-attrs
/Volumes/bbtest/70-extended-attrs/dir-with-xattrs
/Volumes/bbtest/70-extended-attrs/symlink-with-xattrs
/Volumes/bbtest/70-extended-attrs/xattr-test
/Volumes/bbtest/80-access-control-lists
/Volumes/bbtest/80-access-control-lists/acl-test
/Volumes/bbtest/80-access-control-lists/acl-test-dir
/Volumes/bbtest/90-fifo
/Volumes/bbtest/90-fifo/some-fifo
/Volumes/bbtest/95-devices
/Volumes/bbtest/95-devices/devvn0
/Volumes/bbtest/95-devices/devzero
/Volumes/bbtest/99-combo-tests
/Volumes/bbtest/99-combo-tests/many-metadata
/Volumes/bbtest/99-combo-tests/xattr-with-rfork
/Volumes/bbtest/bbouncer-vol

Time: 0.2s
Checked: 69 paths, 365 bytes, 365 B
Saved: 69 paths, 162 bytes, 162 B
Excluded: 0
Dupbytes: 42, 42 B, 25%
Space: 240 B, 139 KB total
No errors
+ hb get -c hb /Volumes/bbtest
HashBackup build #1525 Copyright 2009-2016 HashBackup, LLC
Backup directory: /hbtest/Backup-Bouncer-master/hb
Most recent backup version: 0
Restoring most recent version

Restoring bbtest to /hbtest/Backup-Bouncer-master
/hbtest/Backup-Bouncer-master/bbtest
/hbtest/Backup-Bouncer-master/bbtest/.Trashes
/hbtest/Backup-Bouncer-master/bbtest/.Trashes/501
/hbtest/Backup-Bouncer-master/bbtest/.fseventsd
/hbtest/Backup-Bouncer-master/bbtest/.fseventsd/fseventsd-uuid
/hbtest/Backup-Bouncer-master/bbtest/00-basic-permissions
/hbtest/Backup-Bouncer-master/bbtest/00-basic-permissions/owned-by-me
/hbtest/Backup-Bouncer-master/bbtest/00-basic-permissions/owned-by-root
/hbtest/Backup-Bouncer-master/bbtest/00-basic-permissions/owned-by-www
/hbtest/Backup-Bouncer-master/bbtest/00-basic-permissions/some-dir
/hbtest/Backup-Bouncer-master/bbtest/05-timestamps
/hbtest/Backup-Bouncer-master/bbtest/05-timestamps/some-dir
/hbtest/Backup-Bouncer-master/bbtest/05-timestamps/some-file
/hbtest/Backup-Bouncer-master/bbtest/05-timestamps/some-hardlink
/hbtest/Backup-Bouncer-master/bbtest/10-symlinks
/hbtest/Backup-Bouncer-master/bbtest/10-symlinks/broken_symlink
/hbtest/Backup-Bouncer-master/bbtest/10-symlinks/link2broken_symlink
/hbtest/Backup-Bouncer-master/bbtest/10-symlinks/some-file
/hbtest/Backup-Bouncer-master/bbtest/10-symlinks/symlink1
/hbtest/Backup-Bouncer-master/bbtest/10-symlinks/symlink2
/hbtest/Backup-Bouncer-master/bbtest/10-symlinks/symlink3
/hbtest/Backup-Bouncer-master/bbtest/15-symlink-ownership
/hbtest/Backup-Bouncer-master/bbtest/15-symlink-ownership/some-file
/hbtest/Backup-Bouncer-master/bbtest/15-symlink-ownership/symlink1
/hbtest/Backup-Bouncer-master/bbtest/15-symlink-ownership/symlink2
/hbtest/Backup-Bouncer-master/bbtest/15-symlink-ownership/symlink3
/hbtest/Backup-Bouncer-master/bbtest/20-hardlinks
/hbtest/Backup-Bouncer-master/bbtest/20-hardlinks/link1
/hbtest/Backup-Bouncer-master/bbtest/20-hardlinks/link2
/hbtest/Backup-Bouncer-master/bbtest/20-hardlinks/link3
/hbtest/Backup-Bouncer-master/bbtest/20-hardlinks/some-file
/hbtest/Backup-Bouncer-master/bbtest/30-resource-forks
/hbtest/Backup-Bouncer-master/bbtest/30-resource-forks/hl-rfork1
/hbtest/Backup-Bouncer-master/bbtest/30-resource-forks/hl-rfork2
/hbtest/Backup-Bouncer-master/bbtest/30-resource-forks/some-file
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/bundle-dir
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/bundle-dir/stuff
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/hidden-extension.txt
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/invisible-dir
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/mucho-flags-dir
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/mucho-flags-file
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/system-file
/hbtest/Backup-Bouncer-master/bbtest/40-finder-flags/type-and-creator
/hbtest/Backup-Bouncer-master/bbtest/45-finder-locks
/hbtest/Backup-Bouncer-master/bbtest/45-finder-locks/locked-file
/hbtest/Backup-Bouncer-master/bbtest/50-creation-date
/hbtest/Backup-Bouncer-master/bbtest/50-creation-date/creation-date-test
/hbtest/Backup-Bouncer-master/bbtest/60-bsd-flags
/hbtest/Backup-Bouncer-master/bbtest/60-bsd-flags/dir-with-flags
/hbtest/Backup-Bouncer-master/bbtest/60-bsd-flags/file-with-flags
/hbtest/Backup-Bouncer-master/bbtest/70-extended-attrs
/hbtest/Backup-Bouncer-master/bbtest/70-extended-attrs/dir-with-xattrs
/hbtest/Backup-Bouncer-master/bbtest/70-extended-attrs/symlink-with-xattrs
/hbtest/Backup-Bouncer-master/bbtest/70-extended-attrs/xattr-test
/hbtest/Backup-Bouncer-master/bbtest/80-access-control-lists
/hbtest/Backup-Bouncer-master/bbtest/80-access-control-lists/acl-test
/hbtest/Backup-Bouncer-master/bbtest/80-access-control-lists/acl-test-dir
/hbtest/Backup-Bouncer-master/bbtest/90-fifo
/hbtest/Backup-Bouncer-master/bbtest/90-fifo/some-fifo
/hbtest/Backup-Bouncer-master/bbtest/95-devices
/hbtest/Backup-Bouncer-master/bbtest/95-devices/devvn0
/hbtest/Backup-Bouncer-master/bbtest/95-devices/devzero
/hbtest/Backup-Bouncer-master/bbtest/99-combo-tests
/hbtest/Backup-Bouncer-master/bbtest/99-combo-tests/many-metadata
/hbtest/Backup-Bouncer-master/bbtest/99-combo-tests/xattr-with-rfork
/hbtest/Backup-Bouncer-master/bbtest/bbouncer-vol
Restored /Volumes/bbtest to /hbtest/Backup-Bouncer-master/bbtest
No errors
+ ./bbouncer verify /Volumes/bbtest bbtest
Verifying:    basic-permissions ... ok (Critical)
Verifying:           timestamps ... ok (Critical)
Verifying:             symlinks ... ok (Critical)
Verifying:    symlink-ownership ... ok
Verifying:            hardlinks ... ok (Important)
Verifying:       resource-forks ... ok (Critical)
Verifying:         finder-flags ... ok (Critical)
Verifying:         finder-locks ... ok
Verifying:        creation-date ... ok
Verifying:            bsd-flags ... ok
Verifying:       extended-attrs ... ok (Important)
Verifying: access-control-lists ... ok (Important)
Verifying:                 fifo ... ok
Verifying:              devices ... ok
Verifying:          combo-tests ... ok
sh-3.2#


Script used to run Backup Bouncer test for HashBackup.
Must be run as root to pass the BB test!

#--------- Begin Script ----------------
# unpack Backup Bouncer

# echo commands

set -x
rm -rf Backup-Bouncer-master
unzip Backup-Bouncer-master.zip

# make Backup Bouncer

cd Backup-Bouncer-master
make

# patch BB to remove the nodump attribute
# nodump means "don't save this file", HB honors that,
# but BB expects HB to save the file

patch --context -p1 <<EOF
*** a/tests.d/60-bsd-flags.test
--- b/tests.d/60-bsd-flags.test
***************
*** 38,43 ****
      mkdir dir-with-flags
!     chflags uappnd,uchg,nodump,opaque dir-with-flags
     
      touch file-with-flags
!     chflags uappnd,uchg,nodump,opaque file-with-flags
     
--- 38,43 ----
      mkdir dir-with-flags
!     chflags uappnd,uchg,opaque dir-with-flags
     
      touch file-with-flags
!     chflags uappnd,uchg,opaque file-with-flags
     
EOF

patch --context -p1 <<EOF
*** a/tests.d/99-combo-tests.test
--- b/tests.d/99-combo-tests.test
***************
*** 31,33 ****
      sudo chown www:www many-metadata
!     chflags uappnd,nodump many-metadata
      # Lock the file to make sure the copier doesn't lock it too early
--- 31,33 ----
      sudo chown www:www many-metadata
!     chflags uappnd many-metadata
      # Lock the file to make sure the copier doesn't lock it too early
EOF

# create BB volume and test data

umount -f /Volumes/bbtest
rm -f bbtest.sparseimage
./bbouncer create-vol bbtest
./bbouncer create /Volumes/bbtest

# create the HashBackup backup directory

hb init -c hb

# backup the source directory, then restore it

hb backup -c hb /Volumes/bbtest -v3
hb get -c hb /Volumes/bbtest

# let Backup Bouncer verify the restore

./bbouncer verify /Volumes/bbtest bbtest

#-------- End Script ------------

Comments