ShahriyarR / MySQL-AutoXtraBackup

MySQL-AutoXtraBackup commandline tool written in Python 3 based on Percona XtraBackup
https://autoxtrabackup.azepug.az/
MIT License
141 stars 78 forks source link

Make it possible to prepare all backup prior archiving them #223

Closed ShahriyarR closed 6 years ago

ShahriyarR commented 6 years ago

Feature request from Sven Kummer:

Make it possible to prepare all backups prior archiving them, it will result in already prepared archives of backups.
ShahriyarR commented 6 years ago

Testing the fix:

$ autoxtrabackup -v -lf /home/shahriyar.rzaev/XB_TEST/autoxtrabackup_2_4_5_7____3.log -l DEBUG --defaults_file=/home/shahriyar.rzaev/XB_TEST/server_dir/other_configs/xb_2_4_ps_5_7.conf --backup
2017-12-14 10:58:21 DEBUG    <pid.PidFile object at 0x7f99e6d65368> entering setup
2017-12-14 10:58:21 DEBUG    <pid.PidFile object at 0x7f99e6d65368> create pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-12-14 10:58:21 DEBUG    <pid.PidFile object at 0x7f99e6d65368> check pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-12-14 10:58:21 DEBUG    Running mysqladmin command -> /home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/bin/mysqladmin --defaults-file= --user=root --password= status --socket=/home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/socket.sock
2017-12-14 10:58:21 DEBUG    OK: Server is Up and running
2017-12-14 10:58:21 DEBUG    OK: /home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/bin/mysql exists
2017-12-14 10:58:21 DEBUG    OK: /home/shahriyar.rzaev/XB_TEST/server_dir/PS061217-percona-server-5.7.20-18-linux-x86_64-debug/bin/mysqladmin exists
2017-12-14 10:58:21 DEBUG    Skipping my.cnf check, because it is not specified
2017-12-14 10:58:21 DEBUG    OK: XtraBackup exists
2017-12-14 10:58:21 DEBUG    OK: Main backup directory exists
2017-12-14 10:58:21 DEBUG    OK: Full Backup directory exists
2017-12-14 10:58:21 DEBUG    OK: Increment directory exists
2017-12-14 10:58:21 DEBUG    OK: Archive folder directory exists
2017-12-14 10:58:21 DEBUG    OK: Check status
2017-12-14 10:58:21 DEBUG    - - - - Your full backup is timeout : Taking new Full Backup! - - - -
2017-12-14 10:58:21 DEBUG    Preparing backups prior archiving them...
.
.
.
2017-12-14 10:59:52 DEBUG    - - - - The end of the Prepare Stage. - - - -
2017-12-14 10:59:52 DEBUG    Started to archive previous backups
2017-12-14 11:00:07 DEBUG    OK: Old full backup and incremental backups archived!

.
.
.
171214 11:00:27 completed OK!
2017-12-14 11:00:27 DEBUG    <pid.PidFile object at 0x7f99e6d65368> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
2017-12-14 11:00:27 DEBUG    <pid.PidFile object at 0x7f99e6d65368> closing pidfile: /tmp/MySQL-AutoXtraBackup/autoxtrabackup.pid
ShahriyarR commented 6 years ago

The archives created as:

[shahriyar.rzaev@qaserver-02 XB_TEST]$ ls backup_archives/
2017-12-14_10-51-19.tar.gz  2017-12-14_11-00-07.tar.gz

So it seems to be OK. Can be merged to release_v1.5.1