File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
share/github-backup-utils Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,15 @@ is_skip_truncate_enabled(){
29
29
ghe-ssh " $host " test -e " $GHE_REMOTE_DATA_USER_DIR /common/audit-log-import/skip_truncate"
30
30
}
31
31
32
+ is_binary_backup (){
33
+ ghe-ssh " $host " ghe-config --true " mysql.backup.binary"
34
+ }
35
+
32
36
backup_mysql (){
37
+ if is_binary_backup; then
38
+ ghe_verbose " Skip backup audit_entries for Mysql since it is using binary backup"
39
+ return
40
+ fi
33
41
if is_skip_truncate_enabled; then
34
42
# As skip_truncate exists, we need to also backup the audit entries
35
43
# in MySQL because Elasticsearch may not be fully synced.
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ is_mysql_supported(){
46
46
' test \"\$ENTERPRISE_AUDIT_LOG_MYSQL_LOGGER_ENABLED\" = \"1\""' | ghe-ssh " $GHE_HOSTNAME " -- /bin/bash
47
47
}
48
48
49
+ is_binary_backup (){
50
+ ghe-ssh " $GHE_HOSTNAME " ghe-config --true " mysql.backup.binary"
51
+ }
52
+
49
53
# Helper function to set remote flags in `/data/user/common/audit-log-import`
50
54
# if it's supported, i.e: directory exists.
51
55
set_remote_flag (){
@@ -107,7 +111,17 @@ do_restore(){
107
111
ghe_verbose " Elasticsearch data is available"
108
112
109
113
restore_es
110
- restore_mysql --only-schema
114
+
115
+ if is_binary_backup; then
116
+ ghe_verbose " Table audit_entries is already restored by binary backup"
117
+ else
118
+ restore_mysql --only-schema
119
+ fi
120
+ return
121
+ fi
122
+
123
+ if is_binary_backup; then
124
+ ghe_verbose " Table audit_entries is already restored by binary backup"
111
125
return
112
126
fi
113
127
You can’t perform that action at this time.
0 commit comments