增量式备份
This commit is contained in:
parent
804406ed01
commit
45b31ff8b1
@ -36,7 +36,7 @@ cd $backUpPath
|
|||||||
# mysqldump -u $MYSQL_USER -p$MYSQL_PASSWORD -h $MYSQL_HOST $MYSQL_DATABASE > "$BACKUP_DIR/full_backup.sql"
|
# mysqldump -u $MYSQL_USER -p$MYSQL_PASSWORD -h $MYSQL_HOST $MYSQL_DATABASE > "$BACKUP_DIR/full_backup.sql"
|
||||||
#else
|
#else
|
||||||
echo "docker exec maria /usr/bin/mysqlbinlog -u"${userName}" -p"${password}" -h"${host}" --start-position="${LAST_POSITION}" --stop-position="${CURRENT_POSITION}" "$LAST_BINLOG" > "${backUpPath}"/"${dbName}"-"${currentTime}".sql"
|
echo "docker exec maria /usr/bin/mysqlbinlog -u"${userName}" -p"${password}" -h"${host}" --start-position="${LAST_POSITION}" --stop-position="${CURRENT_POSITION}" "$LAST_BINLOG" > "${backUpPath}"/"${dbName}"-"${currentTime}".sql"
|
||||||
docker exec maria /usr/bin/mysqlbinlog -u${userName} -p${password} -h${host} --start-position=${LAST_POSITION} --stop-position=${CURRENT_POSITION} $LAST_BINLOG > ${backUpPath}/${dbName}-${currentTime}.sql
|
docker exec maria /usr/bin/mysqlbinlog -u${userName} -p${password} -h${host} --start-position=${LAST_POSITION} --stop-position=${CURRENT_POSITION} /var/lib/mysql/$LAST_BINLOG > ${backUpPath}/${dbName}-${currentTime}.sql
|
||||||
#fi
|
#fi
|
||||||
# 更新上次备份的binlog文件名和位置
|
# 更新上次备份的binlog文件名和位置
|
||||||
echo "$CURRENT_BINLOG $CURRENT_POSITION" > "last_backup.txt"
|
echo "$CURRENT_BINLOG $CURRENT_POSITION" > "last_backup.txt"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user