1
0

do not remove local bk if upload failed

This commit is contained in:
michele
2014-03-28 00:43:35 +01:00
parent 7443e3bd11
commit 1987656b0e
2 changed files with 13 additions and 7 deletions

View File

@ -197,6 +197,12 @@ variables:
# take selective backup
EXTRA_EXCLUDES="/jails/test.dom.com" /usr/local/sbin/zfsbk.sh mybk 1
`zfsbk.sh` maintains serialized backups in directory `/backups` after having uploaded them.
If you want to cleanup the backup file locally after uploading it upstream, set the
`CLEAR_BKFILE` environment variable to a non-empty value. `zfsbk.sh` will maintain the local
backup regardless of this variable if the upload failed.
# Managing multiple ZFS Pools
Simply run these scripts once for each pool, setting the _ZPOOL_ environment variable
@ -215,7 +221,7 @@ tested for a number of scenarios, and used in a number of servers.
Because of the inherently partial nature of testing, you are aware that this
brings no guarantees that it'll work for your scenario.
Careful yourself when working with ZFS snapshots! Check this out:
**Careful yourself** when working with ZFS snapshots! Check this out:
zfs destroy -r zroot@mysnap # destroy snapshot 'mysnap' from pool 'zroot'
zfs destroy -r zroot#mysnap # destroy all system data, and comment it's 'mysnap'

View File

@ -114,11 +114,11 @@ then
echo "Expecting rsync://.. or scp://.."
exit 1
fi
fi
# remove backup file if requested
if [ "x$CLEAR_BKFILE" != x ]
# remove local backup if requested & upload was successful
if [ $? -eq 0 -a "x$CLEAR_BKFILE" != x ]
then
# remove backup file if requested
rm -f $bkfile
fi
fi