add check for available backups

This commit is contained in:
LinuxSquare 2025-04-10 21:43:44 +02:00
parent 4a956a45bc
commit 4e72971d7f

View file

@ -38,6 +38,11 @@ function backup_list() {
local backupdir="$(getValueByKey 'PODMAN_DIRECTORY')/${1}/backup"
local found_backups=($(find "$backupdir" -type f -print))
if [[ "${#found_backups[@]}" -eq 0 ]]; then
log i "No backups found for '$1'"
exit 0
fi
log i "Found ${#found_backups[@]} backups:"
for backup in "${found_backups[@]}"; do
echo "- $(basename ${backup%%.*})"