diff --git a/docs/30_Configuration/50_File_transfer.job.md b/docs/30_Configuration/50_File_transfer.job.md index 42368f6a709d343b857a88d9a1fb032ebea790d6..4016f6afd2bf1ff8ea7e8e21db199714922e4698 100644 --- a/docs/30_Configuration/50_File_transfer.job.md +++ b/docs/30_Configuration/50_File_transfer.job.md @@ -163,6 +163,8 @@ restic_keep-weekly = 12 restic_keep-monthly = 12 restic_keep-yearly = 10 +restic_prune-params = --max-unused unlimited --max-repack-size 1G --cleanup-cache + # ---------------------------------------------------------------------- ``` @@ -279,6 +281,8 @@ restic_keep-within = 6m # restic_keep-weekly = 12 # restic_keep-monthly = 12 # 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. @@ -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-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 Default path where to put restored file when running *restore.sh*. diff --git a/jobs/transfer.job.dist b/jobs/transfer.job.dist index 9c1fa30777e933f583e4f79ab17a8680eaa073f4..bd3fffd6dce7a08fed3f7bebf04bd70200101681 100644 --- a/jobs/transfer.job.dist +++ b/jobs/transfer.job.dist @@ -163,4 +163,6 @@ restic_keep-within = 6m # restic_keep-monthly = 12 # restic_keep-yearly = 10 +restic_prune-params = --max-unused unlimited --max-repack-size 1G --cleanup-cache + # ---------------------------------------------------------------------- diff --git a/plugins/transfer/restic.sh b/plugins/transfer/restic.sh index 5aadf383cb3e8d921bf14b75ac06627e4ee433c2..be5b4d37ad44b3fa37d0fbb701e0590000d9eed9 100644 --- a/plugins/transfer/restic.sh +++ b/plugins/transfer/restic.sh @@ -189,19 +189,19 @@ local _mycmd="forget \ --tag $_tag \ --group-by paths,tags \ - --prune \ - --max-unused unlimited \ - --cleanup-cache" + --prune " local _keep for mykeep in last hourly daily weekly monthly yearly within within-hourly within-daily within-weekly within-monthly within-yearly tag do _keep=$( _j_getvar "${STORAGEFILE}" "${CFGPREFIX}keep-${mykeep}") if [ -n "$_keep" ]; then - _mycmd="${_mycmd} --keep-${mykeep} ${_keep}" + _mycmd+="--keep-${mykeep} ${_keep} " fi done + _mycmd+=$( _j_getvar "${STORAGEFILE}" "restic_prune-params") + _restic "$_mycmd" _myrc=$?