#!/bin/ksh ### # Script to test how GNU tar will deal with exclusions. # # mkdir /tmp/gtar-test # work area # cd /tmp/gtar-test # mkdir testdir # test area to back up # mkdir testdir/log # create the test cases # touch testdir/log/do-this-file # ... # touch testdir/log/skip-this-file # ... # vi excludes # set up patterns # Amanda.gtartest | gtar tf - # see what happens # # or, you can use this same script as Amanda.gtartest-exclude and pass # one argument which is the pattern to ignore (ala the exclude option # in amanda.conf vs exclude-list): # # ... # Amanda.gtartest-exclude ./log/skip-this-file | gtar tf - ### if [[ ${0##*/} = Amanda.gtartest-exclude ]] then exclude="--exclude=$1" else exclude="--exclude-from=excludes" fi rm -f incrname touch incrname $DEBUG ${TAR-gtar} \ --create \ --directory testdir \ --listed-incremental incrname \ --sparse \ --one-file-system \ --ignore-failed-read \ --totals \ --file - \ "$exclude" \ .