Merge "gerrit: only backup accountPatchReviewDb"

This commit is contained in:
Zuul 2021-02-09 03:28:41 +00:00 committed by Gerrit Code Review
commit 8278556a0a

View File

@ -326,7 +326,7 @@
user: root
hour: 0
minute: 0
job: '/usr/bin/mysqldump --defaults-file=/root/.gerrit_db.cnf --opt --ignore-table mysql.event --all-databases --single-transaction | gzip -9 > /home/gerrit2/mysql_backups/gerrit.sql.gz'
job: '/usr/bin/mysqldump --defaults-file=/root/.gerrit_db.cnf --opt --ignore-table mysql.event --single-transaction --databases accountPatchReviewDb | gzip -9 > /home/gerrit2/mysql_backups/gerrit.sql.gz'
# Gerrit rotates their own logs, but doesn't clean them out
# Delete logs older than a month
@ -346,8 +346,17 @@
path: /etc/borg-streams
state: directory
- name: Create db streaming file
# NOTE(ianw) 2021-02-09 --all-databases stopped working with
# Xenial/our rax version of mysql so we have to backup db's
# explicitly. remove the old call. This can go after a
# deployment run.
- name: Remove old stream backup
file:
state: absent
path: /etc/borg-streams/mysql
- name: Create accountPatchReviewDb streaming file
copy:
content: >-
/usr/bin/mysqldump --defaults-file=/root/.gerrit_db.cnf --skip-extended-insert --ignore-table mysql.event --all-databases --single-transaction
dest: /etc/borg-streams/mysql
/usr/bin/mysqldump --defaults-file=/root/.gerrit_db.cnf --skip-extended-insert --ignore-table mysql.event --single-transaction --databases accountPatchReviewDb
dest: /etc/borg-streams/mysql-accountPatchReviewDb