Skip to content

Commit cd3473f

Browse files
mpkossenpschiffe
authored andcommitted
Add GLOB in addition to PREFIX because PREFIX is deprecated.
1 parent d9cbd3a commit cd3473f

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ Description of all accepted environment variables follows.
150150

151151
**PRUNE** - if set, prune the repository after backup. Empty by default. [More info](https://borgbackup.readthedocs.io/en/stable/usage.html#borg-prune)
152152

153-
**PRUNE_PREFIX** - filter data to prune by prefix of the archive. Empty by default - prune all data
153+
**GLOB** - filter data to prune by prefix of the archive. Empty by default - prune all data
154+
155+
**PRUNE_PREFIX** - filter data to prune by prefix of the archive. Empty by default - prune all data (DEPRECATED, use **GLOB** instead)
154156

155157
**KEEP_DAILY** - keep specified number of daily backups. Defaults to 7
156158

borg-backup.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ if [ -n "${PRUNE:-}" ]; then
144144
else
145145
PRUNE_PREFIX=''
146146
fi
147+
if [ -n "${GLOB:-}" ]; then
148+
GLOB="--glob-archives=${GLOB}"
149+
else
150+
GLOB=''
151+
fi
147152
if [ -z "${KEEP_DAILY:-}" ]; then
148153
KEEP_DAILY=7
149154
fi
@@ -155,7 +160,7 @@ if [ -n "${PRUNE:-}" ]; then
155160
fi
156161

157162
# shellcheck disable=SC2086
158-
borg prune --stats --show-rc $LOGGING_LEVEL $PROGRESS $PRUNE_PREFIX --keep-daily=$KEEP_DAILY --keep-weekly=$KEEP_WEEKLY --keep-monthly=$KEEP_MONTHLY
163+
borg prune --stats --show-rc $LOGGING_LEVEL $PROGRESS $PRUNE_PREFIX $GLOB --keep-daily=$KEEP_DAILY --keep-weekly=$KEEP_WEEKLY --keep-monthly=$KEEP_MONTHLY
159164
# shellcheck disable=SC2086
160165
borg compact --cleanup-commits --show-rc $LOGGING_LEVEL $PROGRESS
161166
fi

0 commit comments

Comments
 (0)