Compare commits

...

2 Commits

Author SHA1 Message Date
a5a80276ac Folder name should not be plural. 2025-10-14 07:07:07 -07:00
c070d7cb92 Use a dedicated backup directory rather than /tmp. 2025-10-14 07:02:13 -07:00

View File

@@ -11,12 +11,18 @@ source $DIR/../source.env
TAG="Docker"
DATE="`date "+%Y%m%d-%H%M%S"`"
BASENAME="/tmp/Backup"
BACKUP_DIR="/srv/backup"
BASENAME="$BACKUP_DIR/Backup"
file="$BASENAME.$DATE.$HOSTNAME.$TAG.zip"
time="`which time`"
## Main ##
# Ensure backup directory exists with correct permissions.
mkdir -pv $BACKUP_DIR
chmod -Rv 755 $BACKUP_DIR
chown -Rv root:root $BACKUP_DIR
# Remove the last backup.
echo "`date` - Removing existing files."
rm -fv "$BASENAME"*"$TAG"*