configs_backup.sh now saves all root files (not only the docker-compose.yml).
This commit is contained in:
@@ -5,6 +5,8 @@
|
|||||||
#
|
#
|
||||||
# Author: Kovács Zoltán <kovacsz@marcusconsulting.hu>
|
# Author: Kovács Zoltán <kovacsz@marcusconsulting.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-04-28 v0.3
|
||||||
|
# mod: now includes all files (not only YMLFILE) in the base folder.
|
||||||
# 2024-03-07 v0.2
|
# 2024-03-07 v0.2
|
||||||
# fix: tar now dereferences the symlinks (if any).
|
# fix: tar now dereferences the symlinks (if any).
|
||||||
# 2021-09-03 v0.1 Initial release
|
# 2021-09-03 v0.1 Initial release
|
||||||
@@ -26,7 +28,7 @@ MSG_NONWRITE="The target directory isn't writable"
|
|||||||
# Checks the dependencies.
|
# Checks the dependencies.
|
||||||
TR=$(which tr 2>/dev/null)
|
TR=$(which tr 2>/dev/null)
|
||||||
if [ -z "$TR" ]; then echo "$MSG_MISSINGDEP tr."; exit 1 ; fi
|
if [ -z "$TR" ]; then echo "$MSG_MISSINGDEP tr."; exit 1 ; fi
|
||||||
for item in date dirname hostname readlink tar
|
for item in date dirname find hostname readlink tar
|
||||||
do
|
do
|
||||||
if [ -n "$(which $item)" ]
|
if [ -n "$(which $item)" ]
|
||||||
then export $(echo $item | "$TR" '[:lower:]' '[:upper:]' | "$TR" '-' '_')=$(which $item)
|
then export $(echo $item | "$TR" '[:lower:]' '[:upper:]' | "$TR" '-' '_')=$(which $item)
|
||||||
@@ -72,7 +74,7 @@ if [ -w "$BACKUPDIR" ]; then
|
|||||||
BACKUP_NAME="configs.$("$DATE" '+%Y%m%d_%H%M%S').$("$HOSTNAME")"
|
BACKUP_NAME="configs.$("$DATE" '+%Y%m%d_%H%M%S').$("$HOSTNAME")"
|
||||||
( cd "$BASE_DIR"
|
( cd "$BASE_DIR"
|
||||||
"$TAR" czhf "$BACKUPDIR/$BACKUP_NAME.tgz" \
|
"$TAR" czhf "$BACKUPDIR/$BACKUP_NAME.tgz" \
|
||||||
"$YMLFILE" configs docker \
|
$("$FIND" -maxdepth 1 -type f) configs docker \
|
||||||
2>>"$BACKUPDIR/$BACKUP_NAME.log"
|
2>>"$BACKUPDIR/$BACKUP_NAME.log"
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user