I’ve got a bash script that I’ve created to run a backup using innobackupex/xtrabackup, but I’m having an issue actually executing the innobackupex command from the script.
Here is a simplied version of my script highlighting the issue (test.bash):
======================================= #!/bin/bash CMD="/usr/bin/innobackupex --user=username --password=password /var/backups/mysql/test &> /var/backups/mysql/test.log" `$CMD` =======================================
All this is doing is storing the command I want to execute to a variable and then executing it. In my actual script, the command is constructed from other options and settings, but even this simple script fails. The command itself is running the backup, and storing the output in test.log, and running the command in the background
When I try to run this script (e.g., bash test.bash), I get the error:
innobackupex: Too many command line arguments
However, if I literally copy the command above and then paste into the console at a bash prompt, it runs fine.
Anyone have any idea what’s going on here?