Menu

#42 cannot execute binary file

v1.0 (example)
open
nobody
3
2017-04-24
2016-11-28
Pawel S
No

After update to v3.0:

WARNING

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.

Command to run before backups (line 1715)

CONFIG_prebackup="php /var/www/log/backup.before.php"

Command run after backups (line 1982)

CONFIG_postbackup="php /var/www/log/backup.after.php"

Discussion

  • Pawel S

    Pawel S - 2016-12-27

    Seriously, no one knows how to run php file before and after the auto backup?

     
  • Doug E Fresh

    Doug E Fresh - 2017-03-29

    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

     
  • PittaGurneyi

    PittaGurneyi - 2017-04-24

    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.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.