Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbazhenoff committed Jan 7, 2024
1 parent 15b5452 commit 6999268
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions backup/bareos_pool_operations/clean_expired_bareos_volumes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ print_usage_help() {
echo ""
echo "Usage:"
echo ""
echo " -n | --pool-name"
echo " -n | --name"
echo " Pool name ('Full-', etc)."
echo " -a | --action [delete|purge|prune]"
echo " Action after expiration days."
Expand All @@ -111,7 +111,7 @@ while [[ $# -gt 0 ]]; do
KEY="$1"

case $KEY in
-n | --pool-name )
-n | --name )
POOL_NAME="$2"
shift
shift
Expand Down Expand Up @@ -161,8 +161,11 @@ echo "Performing ${POOL_ACTION} \"${POOL_NAME}\" volumes after ${POOL_EXPIRE} da
echo "filtered by \"${POOL_FILTER}\" status... Test mode: ${DRY_RUN}"
if [[ $POOL_ACTION = "delete" ]] || [[ $POOL_ACTION = "prune" ]] || [[ $POOL_ACTION = "purge" ]]; then
cd $POOL_PATH || exit 1
filelist=$(find . -mtime +"$POOL_EXPIRE" -print | grep "$POOL_NAME" | sed 's/[./]//g')
for FILENAME in $filelist
FILELIST=$(find . -mtime +"$POOL_EXPIRE" -print | grep "$POOL_NAME" | sed 's/[./]//g')
if [[ -z $FILELIST ]]; then
echo "No expired by volumes in $POOL_NAME pool by specified criteria ($POOL_EXPIRE days), nothing to $POOL_ACTION."
fi
for FILENAME in $FILELIST
do
# shellcheck disable=SC2012
FILEDATE=$(ls -lh "$FILENAME" | awk '{print $7" "$6" "$8}')
Expand Down

0 comments on commit 6999268

Please sign in to comment.