Merge pull request #518 from github/juruen/check-mysql-audit
Check snapshot contains MySQL audit log dir
This commit is contained in:
Коммит
31605e0fd0
|
@ -39,6 +39,11 @@ cleanup(){
|
|||
ghe-ssh "$GHE_HOSTNAME" -- "sudo rm -rf $remote_dump"
|
||||
}
|
||||
|
||||
# Check whether the snapshot contains any MySQL data at all
|
||||
is_mysql_snapshot(){
|
||||
test -d "$snapshot_dir"
|
||||
}
|
||||
|
||||
# Use ghe-export-audit-logs to fetch the current metadata for all stored
|
||||
# months in MySQL. For each month: number of entries, minum ID, maximum ID
|
||||
fetch_current_meta(){
|
||||
|
@ -204,6 +209,11 @@ restore(){
|
|||
return
|
||||
fi
|
||||
|
||||
if ! is_mysql_snapshot; then
|
||||
ghe_verbose "snapshot doesn't contain MySQL data"
|
||||
return
|
||||
fi
|
||||
|
||||
restore_schema
|
||||
if [ -n "$only_schema" ]; then
|
||||
ghe_verbose "only table schema was imported"
|
||||
|
|
Загрузка…
Ссылка в новой задаче