do not remove local bk if upload failed
This commit is contained in:
@ -197,6 +197,12 @@ variables:
|
|||||||
# take selective backup
|
# take selective backup
|
||||||
EXTRA_EXCLUDES="/jails/test.dom.com" /usr/local/sbin/zfsbk.sh mybk 1
|
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
|
# Managing multiple ZFS Pools
|
||||||
|
|
||||||
Simply run these scripts once for each pool, setting the _ZPOOL_ environment variable
|
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
|
Because of the inherently partial nature of testing, you are aware that this
|
||||||
brings no guarantees that it'll work for your scenario.
|
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 snapshot 'mysnap' from pool 'zroot'
|
||||||
zfs destroy -r zroot#mysnap # destroy all system data, and comment it's 'mysnap'
|
zfs destroy -r zroot#mysnap # destroy all system data, and comment it's 'mysnap'
|
||||||
|
|||||||
12
zfsbk.sh
12
zfsbk.sh
@ -114,11 +114,11 @@ then
|
|||||||
echo "Expecting rsync://.. or scp://.."
|
echo "Expecting rsync://.. or scp://.."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
# remove local backup if requested & upload was successful
|
||||||
|
if [ $? -eq 0 -a "x$CLEAR_BKFILE" != x ]
|
||||||
# remove backup file if requested
|
then
|
||||||
if [ "x$CLEAR_BKFILE" != x ]
|
# remove backup file if requested
|
||||||
then
|
rm -f $bkfile
|
||||||
rm -f $bkfile
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user