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

support "never" for prune-after, verify-after

parent 5dc7370c
Branches
No related tags found
1 merge request!1246725 optimize restic backup params
...@@ -83,6 +83,32 @@ When restoring data ... this is the path for restored files: ...@@ -83,6 +83,32 @@ When restoring data ... this is the path for restored files:
`restore-path = /restore` `restore-path = /restore`
### Prune, Verify
After a transfer you can apply a verify or prune action.
To execute them after each run (which is not needed) set its values to 0.
```txt
prune-after = 0
verify-after = 0
```
You can execute prune and verify only if it didn't run for N days. Set an integer in days here:
```txt
prune-after = 3
verify-after = 7
```
You can disable it to run it as an extra job using verify.sh or prune.sh.
You must disable prune-after if you use rest:https to a restic rest server with enabled append-only option.
```txt
prune-after = never
verify-after = 7
```
### Duplicity settings ### ### Duplicity settings ###
When writing backup data duplicity creates the target file and a index. When writing backup data duplicity creates the target file and a index.
......
...@@ -109,7 +109,8 @@ restore-path = /restore ...@@ -109,7 +109,8 @@ restore-path = /restore
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# number of days when to prune and verify backup. # number of days when to prune and verify backup.
# set it to 0 to run prune and verify in each backup run. # set it to 0 to run prune and verify in each backup
# set it to "never" to disable it during backup and execute it outside the backup run.
prune-after = 3 prune-after = 3
verify-after = 7 verify-after = 7
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
# 2022-11-04 ah v2.8 rename hooks # 2022-11-04 ah v2.8 rename hooks
# 2022-11-07 ah v2.9 run brefore-transfer hook after registration # 2022-11-07 ah v2.9 run brefore-transfer hook after registration
# 2023-02-22 ah v2.10 fix touch of last_backup # 2023-02-22 ah v2.10 fix touch of last_backup
# 2024-02-02 ah v2.11 support "never" for prune-after, verify-after
# ================================================================================ # ================================================================================
...@@ -141,8 +142,13 @@ function setAction(){ ...@@ -141,8 +142,13 @@ function setAction(){
local action=$1 local action=$1
local myfile=$2 local myfile=$2
typeset -i local iLimit local iLimit
iLimit=$(_j_getvar ${STORAGEFILE} "$action-after") iLimit=$(_j_getvar ${STORAGEFILE} "${action}-after")
if [ "$iLimit" = "never" ]; then
echo "Info: $action is set to [never] and is disabled."
doValue=0
return
fi
if [ ! -f "${myfile}" ]; then if [ ! -f "${myfile}" ]; then
echo "Info: $action is ENABLED - no last $action detected" echo "Info: $action is ENABLED - no last $action detected"
...@@ -226,6 +232,7 @@ function setAction(){ ...@@ -226,6 +232,7 @@ function setAction(){
echo echo
fi fi
exit
. $(dirname $0)/plugins/transfer/$STORAGE_BIN.sh || exit 1 . $(dirname $0)/plugins/transfer/$STORAGE_BIN.sh || exit 1
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment