mirror of
https://github.com/fradelg/docker-mysql-cron-backup.git
synced 2025-01-18 08:12:34 +01:00
skip only timestamps when needed
This commit is contained in:
parent
cff595e634
commit
8a15e59c1f
2 changed files with 2 additions and 4 deletions
|
@ -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" ]
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue