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

Add Size, BackupStartTime, BackupCompletionTime columns as part of --tag option #210

Closed ShahriyarR closed 6 years ago

ShahriyarR commented 6 years ago

Again RMAN like output:

RMAN> LIST BACKUP SUMMARY;

Oracle 
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1       B  A  A SBT_TAPE    21-OCT-07       1       1       NO         TAG20071021T094505
2       B  F  A SBT_TAPE    21-OCT-07       1       1       NO         TAG20071021T094513
3       B  A  A SBT_TAPE    21-OCT-07       1       1       NO         TAG20071021T094624
4       B  F  A SBT_TAPE    21-OCT-07       1       1       NO         TAG20071021T094639
5       B  F  A DISK        04-NOV-07       1       1       YES        TAG20071104T195949

From here, --show_tags option can show several useful info, such as: Size, BackupStartTime, BackupCompletionTime, Encrypted, Compressed

During the process will figure out how to implement those. Size -> can be added to backup_tags.txt after backup completion Encrypted -> after backup Compressed -> after backup BackupStartTime -> with start(or keep track for both start and end, then calculate total wasted time)

ShahriyarR commented 6 years ago

For autoxtrabackup tool the backup folder actually created with timestamp which is equal to start time of backup itself.

ShahriyarR commented 6 years ago

Added completion time as:

$ autoxtrabackup -v -lf /home/shahriyar.rzaev/XB_TEST/autoxtrabackup_2_4_5_7.log --defaults_file=/home/shahriyar.rzaev/XB_TEST/server_dir/xb_2_4_ps_5_7.conf --show_tags
Backup              Type    Status  Completion time     TAG
----------------------------------------------------------------------
2017-11-29_15-39-22 Full    FAILED  2017-11-29_15-39-25 'Full Backup'
ShahriyarR commented 6 years ago

Added size:

$ autoxtrabackup -v -lf /home/shahriyar.rzaev/XB_TEST/autoxtrabackup_2_4_5_7.log --defaults_file=/home/shahriyar.rzaev/XB_TEST/server_dir/xb_2_4_ps_5_7.conf --show_tags
Backup              Type    Status  Completion_time     Size    TAG
----------------------------------------------------------------------------------
2017-11-29_16-27-35 Full    FAILED  2017-11-29_16-27-38 5,0M    'Full Backup'
ShahriyarR commented 6 years ago

The xtrabackup_info file includes all sort of information about backup:

uuid = fdbe0afc-d5b3-11e7-9b15-002590e9b448
name = 
tool_name = xtrabackup
tool_command = --defaults-file= --user=root --password=... --target-dir=/home/shahriyar.rzaev/XB_TEST/backup_dir/ps_5_7_x_2_4/full/2017-11-30_09-50-55 --backup --socket=/home/shahriyar.rzaev/XB_TEST/server_dir/PS291117-percona-server-5.7.20-18-linux-x86_64-debug/socket.sock --compress=quicklz --compress-chunk-size=65536 --compress-threads=4 --encrypt=AES256 --encrypt-key=... --encrypt-threads=4 --encrypt-chunk-size=65536 --slave-info --no-version-check --core-file --parallel=10 --throttle=40 --check-privileges --keyring-file-data=/home/shahriyar.rzaev/XB_TEST/server_dir/PS291117-percona-server-5.7.20-18-linux-x86_64-debug/mysql-keyring/keyring --stream=xbstream
tool_version = 2.4.8
ibbackup_version = 2.4.8
server_version = 5.7.20-18-debug
start_time = 2017-11-30 09:50:55
end_time = 2017-11-30 09:51:09
lock_time = 0
binlog_pos = 
innodb_from_lsn = 0
innodb_to_lsn = 2573994
partial = N
incremental = N
format = xbstream
compact = N
compressed = compressed
encrypted = Y
ShahriyarR commented 6 years ago

I can parse this file but it is somehow impossible when the backup streaming is enabled. And this requires some code changes as well in backup side. I am going to separate the task to add compressed/encrypted part of info in another branch where, I will change backup process.

And now this issue can be closed and changes can be merged to release_v1.5.1