1
0
Fork 0
mirror of https://github.com/yavook/kiwi-backup.git synced 2024-11-22 06:53:00 +00:00

default backup policy, environment variable names

This commit is contained in:
Jörn-Michael Miehe 2023-08-30 21:54:01 +02:00
parent fe383051d5
commit 49951babc8
3 changed files with 27 additions and 16 deletions

View file

@ -85,9 +85,9 @@ ENV \
################# #################
SCHEDULE_BACKUP="R 2 * * *" \ SCHEDULE_BACKUP="R 2 * * *" \
SCHEDULE_CLEANUP="R 4 * * *" \ SCHEDULE_CLEANUP="R 4 * * *" \
FULL_BACKUP_FREQUENCY=3M \ POLICY_FULL_BACKUP_FREQUENCY=1W \
BACKUP_RETENTION_TIME=6M \ POLICY_BACKUP_RETENTION_TIME=1M \
KEEP_NUM_FULL_CHAINS=2 \ POLICY_KEEP_NUM_CHAINS=3 \
\ \
###################### ######################
# ADDITIONAL OPTIONS # # ADDITIONAL OPTIONS #

View file

@ -23,13 +23,24 @@ backup:
- backups the entire service data directory - backups the entire service data directory
- stores all backup data on the host file system - stores all backup data on the host file system
- daily incremental backups at night - daily incremental backups at night
- a new full backup once every 3 months - a new full backup once every week
- keeps backups up to 6 months old - keeps backups up to 1 month old
- keeps daily backups for two recent sets (3-6 months) - keeps daily backups for three recent sets (2-3 weeks)
- backup jobs run at a random minute past 2 am - backup jobs run at a random minute past 2 am
Be aware though -- backups will use a fair bit of storage space! Be aware though -- backups will use a fair bit of storage space!
## Changes
### Version `0.13`
- **Changed default backup policy**
- *old:* full backup 3 months, keep 6 months, keep 2 chains
- *new:* full backup 1 week, keep 1 month, keep 3 chains
- **Changed environment variable names**
- *old:* `FULL_BACKUP_FREQUENCY`, `BACKUP_RETENTION_TIME`, `KEEP_NUM_FULL_CHAINS`
- *new:* `POLICY_FULL_BACKUP_FREQUENCY`, `POLICY_BACKUP_RETENTION_TIME`, `POLICY_KEEP_NUM_CHAINS`
## Customization ## Customization
The kiwi-backup image allows for extensive customization even without creating a local image variant. The kiwi-backup image allows for extensive customization even without creating a local image variant.
@ -75,16 +86,16 @@ backup:
SCHEDULE_CLEANUP: "R 4 * * *" SCHEDULE_CLEANUP: "R 4 * * *"
# how often to opt for a full backup # how often to opt for a full backup
# default: every 3 months # default: every week
FULL_BACKUP_FREQUENCY: "3M" POLICY_FULL_BACKUP_FREQUENCY: "1W"
# how long to keep backups at all # how long to keep backups at all
# default: 6 months # default: 1 month
BACKUP_RETENTION_TIME: "6M" POLICY_BACKUP_RETENTION_TIME: "1M"
# how many full backup chains with incrementals to keep # how many backup chains with incrementals to keep
# default: 2 # default: 3
KEEP_NUM_FULL_CHAINS: "2" POLICY_KEEP_NUM_CHAINS: "3"
``` ```
### Handling Secrets ### Handling Secrets

View file

@ -49,7 +49,7 @@ case "${task}" in
backup) backup)
printf ' --allow-source-mismatch' printf ' --allow-source-mismatch'
printf ' --volsize %s' "${BACKUP_VOLSIZE}" printf ' --volsize %s' "${BACKUP_VOLSIZE}"
printf ' --full-if-older-than %s' "${FULL_BACKUP_FREQUENCY}" printf ' --full-if-older-than %s' "${POLICY_FULL_BACKUP_FREQUENCY}"
printf '%s' "$( add_space "${OPTIONS_BACKUP}" )" printf '%s' "$( add_space "${OPTIONS_BACKUP}" )"
printf ' %s' "${BACKUP_SOURCE}" printf ' %s' "${BACKUP_SOURCE}"
;; ;;
@ -61,13 +61,13 @@ case "${task}" in
;; ;;
rmfull) rmfull)
printf ' remove-older-than %s' "${BACKUP_RETENTION_TIME}" printf ' remove-older-than %s' "${POLICY_BACKUP_RETENTION_TIME}"
printf ' --force' printf ' --force'
printf '%s' "$( add_space "${OPTIONS_RMFULL}" )" printf '%s' "$( add_space "${OPTIONS_RMFULL}" )"
;; ;;
rmincr) rmincr)
printf ' remove-all-inc-of-but-n-full %s' "${KEEP_NUM_FULL_CHAINS}" printf ' remove-all-inc-of-but-n-full %s' "${POLICY_KEEP_NUM_CHAINS}"
printf ' --force' printf ' --force'
printf '%s' "$( add_space "${OPTIONS_RMINCR}" )" printf '%s' "$( add_space "${OPTIONS_RMINCR}" )"
;; ;;