4 Commits

Author SHA1 Message Date
Max Konrädi
901cd5487f chore: Changelog 2025-08-13 14:58:23 +02:00
Max Konrädi
a66e72cb7e Merge pull request #103 from lobaro/feat/check_after_forget_prune
feat: add restic check after forget with prune
2025-08-13 14:56:17 +02:00
Max Konrädi
5f2b322e54 feat: add restic check after forget with prune 2025-08-13 13:43:48 +02:00
Max Konrädi
50e6fdbdf2 chore: Update CHANGELOG.md
v1.4.0
2025-04-23 15:04:50 +02:00
2 changed files with 26 additions and 1 deletions

View File

@@ -1,6 +1,10 @@
# Changelog
## Unreleased
## v1.4.1
### Changed
* Execute a repository check after prune was passed as a parameter in the forget call
## v1.4.0
### Added
* Option to set the target folder backup

View File

@@ -48,6 +48,8 @@ else
copyErrorLog
fi
forgetSuccess=false
if [[ $backupRC == 0 ]] && [ -n "${RESTIC_FORGET_ARGS}" ]; then
echo "Forget about old snapshots based on RESTIC_FORGET_ARGS = ${RESTIC_FORGET_ARGS}"
restic forget ${RESTIC_FORGET_ARGS} >> ${lastLogfile} 2>&1
@@ -55,9 +57,28 @@ if [[ $backupRC == 0 ]] && [ -n "${RESTIC_FORGET_ARGS}" ]; then
logLast "Finished forget at $(date)"
if [[ $rc == 0 ]]; then
echo "Forget Successful"
forgetSuccess=true
else
echo "Forget Failed with Status ${rc}"
restic unlock
forgetSuccess=false
copyErrorLog
fi
fi
echo "$RESTIC_FORGET_ARGS" | grep -q prune
wasPruneRC=$?
if [ "$forgetSuccess" = true ] && [ $wasPruneRC -eq 0 ]; then
echo "Checking repository after forget / prune"
restic check >> ${lastLogfile} 2>&1
rc=$?
logLast "Finished check at $(date)"
if [ $rc = 0 ]; then
echo "Check Successful"
else
echo "Check Failed with Status ${rc}"
restic unlock
copyErrorLog
fi
fi