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

restic prune: add keep-last; add --cleanup-cache

parent 288ac3d6
No related branches found
No related tags found
1 merge request!325046 finetune restic params
...@@ -172,8 +172,11 @@ is a full backup and all following runs make an incremental backup. ...@@ -172,8 +172,11 @@ is a full backup and all following runs make an incremental backup.
You have the possibility to keep all younger backups and have the possibility to delete You have the possibility to keep all younger backups and have the possibility to delete
older backups but to keep N weekly, monthly and yearly snapshots. older backups but to keep N weekly, monthly and yearly snapshots.
The value for "keep-last" never deletes the last N most recent snapshots.
```text ```text
# prune # prune
restic_keep-last = 5
restic_keep-hourly = 100 restic_keep-hourly = 100
restic_keep-daily = 90 restic_keep-daily = 90
restic_keep-weekly = 12 restic_keep-weekly = 12
......
...@@ -147,6 +147,7 @@ restic_tag = imlbackup ...@@ -147,6 +147,7 @@ restic_tag = imlbackup
restic_mountpoint = /mnt/restore restic_mountpoint = /mnt/restore
# prune # prune
restic_keep-last = 5
restic_keep-hourly = 100 restic_keep-hourly = 100
restic_keep-daily = 90 restic_keep-daily = 90
restic_keep-weekly = 12 restic_keep-weekly = 12
......
...@@ -160,23 +160,24 @@ ...@@ -160,23 +160,24 @@
echo "--- PRUNE" echo "--- PRUNE"
local _tag=$( _j_getvar ${STORAGEFILE} "${CFGPREFIX}tag") local _tag=$( _j_getvar ${STORAGEFILE} "${CFGPREFIX}tag")
local _keep_h=$( _j_getvar ${STORAGEFILE} "${CFGPREFIX}keep-hourly")
local _keep_d=$( _j_getvar ${STORAGEFILE} "${CFGPREFIX}keep-daily")
local _keep_w=$( _j_getvar ${STORAGEFILE} "${CFGPREFIX}keep-weekly")
local _keep_m=$( _j_getvar ${STORAGEFILE} "${CFGPREFIX}keep-monthly")
local _keep_y=$( _j_getvar ${STORAGEFILE} "${CFGPREFIX}keep-yearly")
local _mycmd="restic forget \ local _mycmd="restic forget \
${ARGS_DEFAULT} \ ${ARGS_DEFAULT} \
--tag $_tag \ --tag $_tag \
--group-by "paths,tags" \ --group-by paths,tags \
--keep-hourly $_keep_h \ --cleanup-cache"
--keep-daily $_keep_d \
--keep-weekly $_keep_w \ local _keep
--keep-monthly $_keep_m \ for mykeep in last hourly daily weekly monthly yearly
--keep-yearly $_keep_y" do
_keep=$( _j_getvar "${STORAGEFILE}" "${CFGPREFIX}keep-${mykeep}")
if [ -n "$_keep" ]; then
_mycmd="${_mycmd} --keep-${mykeep} ${_keep}"
fi
done
echo $_mycmd echo $_mycmd
sleep 3
color cmd color cmd
eval $_mycmd eval $_mycmd
local _myrc=$? local _myrc=$?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment