The rotate folders task now also handles subfolders in the backup area in daily maintenance job.
This commit is contained in:
@@ -7,9 +7,11 @@
|
||||
# Uses the acme wrapper script which have to exist in same folder
|
||||
# as this script.
|
||||
#
|
||||
# Author: Kovács Zoltán <kovacs.zoltan@smartfront.hu>
|
||||
# Kovács Zoltán <kovacsz@marcusconsulting.hu>
|
||||
# Author: 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)
|
||||
# 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.
|
||||
|
||||
Reference in New Issue
Block a user