After update to v3.0:
Errors reported during AutoMySQLBackup execution.. Backup failed
Error log below..
/usr/local/bin/automysqlbackup: line 1715: source: /usr/bin/php: cannot execute binary file
/usr/local/bin/automysqlbackup: line 1982: source: /usr/bin/php: cannot execute binary file
These files are the same and worked on the previous version.
CONFIG_prebackup="php /var/www/log/backup.before.php"
CONFIG_postbackup="php /var/www/log/backup.after.php"
Seriously, no one knows how to run php file before and after the auto backup?
For anyone that runs across this in the future, the solution is to not put a command directly into these configuration options like the example in this question. automysqlbackup uses "source" to run whatever you put here. so if it won't run with source, you can't run it.
Here's the code from automysqlbackup that executes whatever you put there:
# -> preback commands
if [[ "${CONFIG_prebackup}" ]]; then
echo "======================================================================"
echo "Prebackup command output."
echo
source ${CONFIG_prebackup}
echo
echo "======================================================================"
echo
fi
# <- preback commands
source expects a shell file with commands in it.
Just create backup-before.sh with your command "php /var/www/log/backup.before.php" in it.
The same with backup-after.sh ...
And point CONFIG_prebackup="/path/to/backup-before.sh" in the right direction.
It is probably a good idea to add a comment or two in the config file to make this more clear.