skip only timestamps when needed

This commit is contained in:
Fco. Javier Delgado del Hoyo 2024-12-09 12:23:08 +01:00
parent cff595e634
commit 8a15e59c1f
2 changed files with 2 additions and 4 deletions

View file

@ -32,8 +32,7 @@ do
BASIC_OPTS="--single-transaction" BASIC_OPTS="--single-transaction"
if [ -n "$REMOVE_DUPLICATES" ] if [ -n "$REMOVE_DUPLICATES" ]
then then
echo "WARNING: disabling comments in backup to remove deuplicate backups. Automatic database name detection won't work so set MYSQL_DATABASE on restore" BASIC_OPTS="$BASIC_OPTS --skip-dump-date"
BASIC_OPTS="$BASIC_OPTS" --skip-comments
fi fi
if mysqldump $BASIC_OPTS $MYSQLDUMP_OPTS -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" $MYSQL_SSL_OPTS "$db" > "$FILENAME" if mysqldump $BASIC_OPTS $MYSQLDUMP_OPTS -h "$MYSQL_HOST" -P "$MYSQL_PORT" -u "$MYSQL_USER" -p"$MYSQL_PASS" $MYSQL_SSL_OPTS "$db" > "$FILENAME"
then then
@ -52,7 +51,7 @@ do
cd /backup || exit && ln -s "$BASENAME" "$(basename "$LATEST")" cd /backup || exit && ln -s "$BASENAME" "$(basename "$LATEST")"
if [ -n "$REMOVE_DUPLICATES" ] if [ -n "$REMOVE_DUPLICATES" ]
then then
echo "=> Removing duplicate database dumps" echo "==> Removing duplicate database dumps"
fdupes -idN /backup/ fdupes -idN /backup/
fi fi
if [ -n "$MAX_BACKUPS" ] if [ -n "$MAX_BACKUPS" ]

View file

@ -30,7 +30,6 @@ services:
environment: environment:
- MYSQL_HOST=my_mariadb - MYSQL_HOST=my_mariadb
- MYSQL_USER=root - MYSQL_USER=root
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_PASS=${MARIADB_ROOT_PASSWORD} - MYSQL_PASS=${MARIADB_ROOT_PASSWORD}
- MAX_BACKUPS=1 - MAX_BACKUPS=1
- INIT_BACKUP=1 - INIT_BACKUP=1