Skip to content
Snippets Groups Projects
Commit eedd0e15 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add restic_prune-params

parent 9b94dd5f
No related branches found
No related tags found
1 merge request!121add restic_prune-params
...@@ -163,6 +163,8 @@ restic_keep-weekly = 12 ...@@ -163,6 +163,8 @@ restic_keep-weekly = 12
restic_keep-monthly = 12 restic_keep-monthly = 12
restic_keep-yearly = 10 restic_keep-yearly = 10
restic_prune-params = --max-unused unlimited --max-repack-size 1G --cleanup-cache
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
``` ```
...@@ -279,6 +281,8 @@ restic_keep-within = 6m ...@@ -279,6 +281,8 @@ restic_keep-within = 6m
# restic_keep-weekly = 12 # restic_keep-weekly = 12
# restic_keep-monthly = 12 # restic_keep-monthly = 12
# restic_keep-yearly = 10 # restic_keep-yearly = 10
restic_prune-params = --max-unused unlimited --max-repack-size 1G --cleanup-cache
``` ```
For pruning with restic forget the following values can be used. For pruning with restic forget the following values can be used.
...@@ -292,6 +296,9 @@ See the docs for more details to the keep values of the forget command <https:// ...@@ -292,6 +296,9 @@ See the docs for more details to the keep values of the forget command <https://
* restic_keep-within-(hourly|daily|weekly|monthly|yearly) [duration] - keep snapshots of given period that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot * restic_keep-within-(hourly|daily|weekly|monthly|yearly) [duration] - keep snapshots of given period that are newer than duration (eg. 1y5m7d2h) relative to the latest snapshot
* restic_keep-tag [taglist] - keep snapshots with this taglist (can be specified only one in imlbackup) (default []) * restic_keep-tag [taglist] - keep snapshots with this taglist (can be specified only one in imlbackup) (default [])
* restic_prune-params [options] - additional prune options. see `restic prune help`
## restore-path ## restore-path
Default path where to put restored file when running *restore.sh*. Default path where to put restored file when running *restore.sh*.
......
...@@ -163,4 +163,6 @@ restic_keep-within = 6m ...@@ -163,4 +163,6 @@ restic_keep-within = 6m
# restic_keep-monthly = 12 # restic_keep-monthly = 12
# restic_keep-yearly = 10 # restic_keep-yearly = 10
restic_prune-params = --max-unused unlimited --max-repack-size 1G --cleanup-cache
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
...@@ -189,19 +189,19 @@ ...@@ -189,19 +189,19 @@
local _mycmd="forget \ local _mycmd="forget \
--tag $_tag \ --tag $_tag \
--group-by paths,tags \ --group-by paths,tags \
--prune \ --prune "
--max-unused unlimited \
--cleanup-cache"
local _keep local _keep
for mykeep in last hourly daily weekly monthly yearly within within-hourly within-daily within-weekly within-monthly within-yearly tag for mykeep in last hourly daily weekly monthly yearly within within-hourly within-daily within-weekly within-monthly within-yearly tag
do do
_keep=$( _j_getvar "${STORAGEFILE}" "${CFGPREFIX}keep-${mykeep}") _keep=$( _j_getvar "${STORAGEFILE}" "${CFGPREFIX}keep-${mykeep}")
if [ -n "$_keep" ]; then if [ -n "$_keep" ]; then
_mycmd="${_mycmd} --keep-${mykeep} ${_keep}" _mycmd+="--keep-${mykeep} ${_keep} "
fi fi
done done
_mycmd+=$( _j_getvar "${STORAGEFILE}" "restic_prune-params")
_restic "$_mycmd" _restic "$_mycmd"
_myrc=$? _myrc=$?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment