Bug #71674 Enterprise Backup is using single quote instead of double. Breaks variable.
Submitted: 11 Feb 2014 23:06 Modified: 11 Mar 2014 23:44
Reporter: Jesse Duce Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:6.0.7.11215, 6.0.9 OS:MacOS
Assigned to: CPU Architecture:Any
Tags: Enterprise Backup, workbench

[11 Feb 2014 23:06] Jesse Duce
Description:
It appears that nothing happens when Executing or Scheduling an online backup with MySQL Enterprise Backup within MySQL Workbench.  In actuality, standard out is not making it back to the client because of an improperly quoted variable.

When clicking execute now - you get a blank window.  No log shows up in the history.  When you click schedule, you'll get an entry for a log, but it is empty.

This is an example of what is executed (pulled out of crontab), it has single quotes surrounding a variable - single quotes preserve the literal characters and prevent the variable interpolation.
BACKUP_NAME=$(date +\%Y-\%m-\%d_\%H-\%M-\%S); /opt/mysql/meb-3.9/bin/mysqlbackup --defaults-file="/home/mysql/backups/46ac61c5-9297-11e3-be98-10ddb1aa051f.cnf" --backup-dir="/home/mysql/backups/new_backup/$BACKUP_NAME" --show-progress=stdout backup > '/home/mysql/backups/new_backup/$BACKUP_NAME.log 2>&1'

I end up with a file named "$BACKUP_NAME.log 2>&1"

I think it is supposed to look like this…

BACKUP_NAME=$(date +\%Y-\%m-\%d_\%H-\%M-\%S); /opt/mysql/meb-3.9/bin/mysqlbackup --defaults-file="/home/mysql/backups/46ac61c5-9297-11e3-be98-10ddb1aa051f.cnf" --backup-dir="/home/mysql/backups/new_backup/$BACKUP_NAME" --show-progress=stdout backup > "/home/mysql/backups/new_backup/$BACKUP_NAME.log" 2>&1

How to repeat:
Try to run an online backup through MySQL Workbench's Enterprise Backup screen.

Suggested fix:
Change the single quotes to double quotes.
Move the outer double quote inward, so that stderr redirect is not in quotes.
[13 Feb 2014 11:34] MySQL Verification Team
Hello Jesse,

Thank you for the bug report.
Verified as described.

Thanks,
Umesh
[13 Feb 2014 11:35] MySQL Verification Team
// How to repeat	
// Setup 

1) WB -> Online Backup
2) Schedule backup

		
	 
// Confirm the crontab entry

root@ushastry ~]# crontab -l
0 * * * * BACKUP_NAME=$(date +\%Y-\%m-\%d_\%H-\%M-\%S); /opt/mysql/meb-3.9/bin/mysqlbackup --defaults-file="/tmp/backup/e2e37e8c-94a0-11e3-80e1-0800272e2cce.cnf" --backup-dir="/tmp/backup/backup/$BACKUP_NAME" --show-progress=stdout backup > '/tmp/backup/backup/$BACKUP_NAME.log 2>&1'

	
// Check the /tmp/ for file starting with $BACK*	
	
-rw-r--r--. 1 root root    0 Feb 13 17:00 $BACKUP_NAME.log 2>&1
[11 Mar 2014 21:48] Philip Olson
Fixed as of the upcoming MySQL Workbench 6.1.3 release, and here's the changelog entry:

On Linux, a scheduled and executed MEB "Online Backup" would not output
the error log to "stderr". Also, the saved log file was always named
"$BACKUP_NAME.log", by using the literal '$BACKUP_NAME' instead of parsing
it as a variable.

Thank you for the bug report.
[11 Mar 2014 23:44] Jesse Duce
Fantastic, thank you Philip.