From cccb11cd32bf036482bff78b6bcfcc755ede6d54 Mon Sep 17 00:00:00 2001 From: John Gaunt Date: Tue, 17 Aug 2021 15:17:25 -0400 Subject: [PATCH] added restic backup and prune commands. the prune still needs work --- restic.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/restic.sh b/restic.sh index 83af601..2d0365a 100644 --- a/restic.sh +++ b/restic.sh @@ -62,18 +62,11 @@ if [ "${LATEST_RESTIC_VERSION}" != "${INSTALLED_RESTIC_VERSION}" ] || [ ! -e '/u fi fi -# check if the /.duplicacy/preferences file exists before continuing -if [ ! -e "/.duplicacy/preferences" ] || [ ! -e "/.duplicacy/filters" ]; then - echo "ERROR: Duplicacy not yet configured. Please refer to readme file" - exit -fi - # run the backup -cd / -duplicacy -verbose -log backup -stats >> ${LOGFILE} 2>&1 +restic --cleanup-cache --verbose backup ${BACKUPS} >> ${LOGFILE} 2>&1 # prune the backup -duplicacy -verbose -log prune -keep 0:360 -keep 30:180 -keep 7:30 -keep 1:7 >> ${LOGFILE} 2>&1 +restic --verbose forget --keep-daily 7 --keep-weekly 5 --keep-monthly 12 --keep-yearly 75 --prune >> ${LOGFILE} 2>&1 # copy the backup to offsite but only if the backup id as passed in if [ "${1}" == "--copyOffsite" ] || [ "${1}" == "-c" ]; then