The rotate folders task now also handles subfolders in the backup area in daily maintenance job.

This commit is contained in:
Kovács Zoltán
2026-09-28 16:24:58 +02:00
parent 99a83f318a
commit 627a8f81b3
+8 -5
View File
@@ -7,9 +7,11 @@
# Uses the acme wrapper script which have to exist in same folder # Uses the acme wrapper script which have to exist in same folder
# as this script. # as this script.
# #
# Author: Kovács Zoltán <kovacs.zoltan@smartfront.hu> # Author: Kovács Zoltán <kovacsz@marcusconsulting.hu>
# Kovács Zoltán <kovacsz@marcusconsulting.hu> # Kovács Zoltán <kovacs.zoltan@smartfront.hu>
# License: GNU/GPL v3+ (https://www.gnu.org/licenses/gpl-3.0.en.html) # 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 # 2026-02-16 v1.1
# new: It now also calls the SSL web certificate expiration checker utility. # new: It now also calls the SSL web certificate expiration checker utility.
# 2023-06-18 v1.0 # 2023-06-18 v1.0
@@ -20,6 +22,7 @@
# Checks the components. # Checks the components.
[[ -z "$(which dirname)" ]] && exit 1 [[ -z "$(which dirname)" ]] && exit 1
[[ -z "$(which find)" ]] && exit 1
[[ -z "$(which readlink)" ]] && exit 1 [[ -z "$(which readlink)" ]] && exit 1
[[ -z "$(which xargs)" ]] && exit 1 [[ -z "$(which xargs)" ]] && exit 1
@@ -54,13 +57,13 @@ fi
# Rotates the backup folders. # 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" #" 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 do
if [ -n "$folder" ]; then if [ -n "$folder" ]; then
# Dereferenced absolute path. # Dereferenced absolute path.
folder="$("$(which readlink)" -e "$BACKUPSROOT/$folder")" #" folder="$("$(which readlink)" -e "$folder")" #"
# Does it a folder with a prepared configuration? # Does it a folder with a prepared configuration?
if [ -d "$folder" -a -r "$folder/.rotate_folder.conf" ]; then if [ -d "$folder" -a -r "$folder/.rotate_folder.conf" ]; then
# Does the rotate job. # Does the rotate job.