Skip to content
Snippets Groups Projects
Commit 1cc50d05 authored by Guillaume Subiron's avatar Guillaume Subiron
Browse files

borg: add keephourly, keepdaily, keepweekly and keepmonthly variables

parent 1d7e00fa
No related branches found
No related tags found
1 merge request!69Multiple improvements in borg handler
......@@ -130,6 +130,16 @@ exclude = /var/lib/mysql
## Default:
# keep = 30d
## define hourly, daily, weekly and monthly retention for the "borg prune" operation.
##
## theses options will be ignored if set to 0
##
## Default:
## keephourly = 0
## keepdaily = 0
## keepweekly = 0
## keepmonthly = 0
## define extra command-line options for the "borg prune" operation.
##
## Example:
......
......@@ -41,6 +41,10 @@ getconf exclude
getconf create_options
getconf prune yes
getconf keep 30d
getconf keephourly 0
getconf keepdaily 0
getconf keepweekly 0
getconf keepmonthly 0
getconf prune_options
getconf cache_directory
getconf filter_warnings yes
......@@ -240,6 +244,18 @@ if [ "$prune" == "yes" ]; then
if [ ! "$keep" == "0" ]; then
prune_options="${prune_options} --keep-within=${keep}"
fi
if [ ! "$keephourly" == "0" ]; then
prune_options="${prune_options} --keep-hourly=${keephourly}"
fi
if [ ! "$keepdaily" == "0" ]; then
prune_options="${prune_options} --keep-daily=${keepdaily}"
fi
if [ ! "$keepweekly" == "0" ]; then
prune_options="${prune_options} --keep-weekly=${keepweekly}"
fi
if [ ! "$keepmonthly" == "0" ]; then
prune_options="${prune_options} --keep-monthly=${keepmonthly}"
fi
prunestr="borg prune $options $prune_options $execstr_repository"
debug "executing borg prune"
debug "$prunestr"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment