1
0

add DELETE_OUTDATED to prune old remote bkfiles

This commit is contained in:
michele
2014-04-19 13:00:53 +02:00
parent 4d72ac0ecc
commit 32adb7b11c
2 changed files with 37 additions and 2 deletions

View File

@ -204,12 +204,38 @@ If you want to cleanup the backup file locally after uploading it upstream, set
`CLEAR_BKFILE` environment variable to a non-empty value. `zfsbk.sh` will maintain the local
backup regardless of this variable if the upload failed.
# delete generated bkfile locally after successful upload
UPLOAD_PATH="..." CLEAR_BKFILE=yep /usr/local/sbin/zfsbk.sh mybk 7
Ask `zfsbk` to remove an old sequence remotely before uploading a new one:
# remove all bkfiles of old sequence *remotely* before uploading new one
UPLOAD_PATH="..." DELETE_OUTDATED="yep" /usr/local/sbin/zfsbk.sh mybk 7
This allows you to cap the size taken by backups at the remote.
# Managing multiple ZFS Pools
Simply run these scripts once for each pool, setting the _ZPOOL_ environment variable
accordingly.
# Summary of control variables
Here's all environment variables controlling the behavior or `zfssnap` and `zfsbk`:
## zfssnap
* `ZPOOL` [str] name of the ZFS pool to operate on.
* `EXCLUDES` [str] space-separated list of dataset names to exclude from snapshots. Overrides defaults.
* `EXTRA_EXCLUDES` [str] space-separated list of dataset names to exclude from snapshots in addition to defaults.
## zfsbk
* `UPLOAD_PATH` [str] Upload generated bkfile to this remote location; 'scp://' or 'rsync://'
* `CLEAR_BKFILE` [any] If non-empty, remove copy of generated bkfile after successful remote upload.
* `DELETE_OUTDATED` [any] If non-empty, remove old backup sequence remotely before uploading first bkfile of a new sequence.
# Ancillaries
## Warranty