diff --git a/tools/maintenance_daily b/tools/maintenance_daily index 641d2a7..9ff28eb 100755 --- a/tools/maintenance_daily +++ b/tools/maintenance_daily @@ -7,9 +7,11 @@ # Uses the acme wrapper script which have to exist in same folder # as this script. # -# Author: Kovács Zoltán -# Kovács Zoltán +# Author: Kovács Zoltán +# Kovács Zoltán # License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html) +# 2026-06-05 v1.2 +# mod: The rotate folders task now also handles subfolders in the backup area. # 2026-02-16 v1.1 # new: It now also calls the SSL web certificate expiration checker utility. # 2023-06-18 v1.0 @@ -20,6 +22,7 @@ # Checks the components. [[ -z "$(which dirname)" ]] && exit 1 +[[ -z "$(which find)" ]] && exit 1 [[ -z "$(which readlink)" ]] && exit 1 [[ -z "$(which xargs)" ]] && exit 1 @@ -54,13 +57,13 @@ fi # Rotates the backup folders. # -# Enumerates the folders and tries to rotate they content. +# Enumerates the folder structure and tries to rotate they content. BACKUPSROOT="$("$(which dirname)" "$SCRPATH")/storage/backups" #" -for folder in $(ls -1 "$BACKUPSROOT" 2>/dev/null | $(which xargs) -0 ) "" +for folder in $("$(which find)" "$BACKUPSROOT"/* -type d 2>/dev/null | $(which xargs) -0 ) "" #" do if [ -n "$folder" ]; then # Dereferenced absolute path. - folder="$("$(which readlink)" -e "$BACKUPSROOT/$folder")" #" + folder="$("$(which readlink)" -e "$folder")" #" # Does it a folder with a prepared configuration? if [ -d "$folder" -a -r "$folder/.rotate_folder.conf" ]; then # Does the rotate job.