sebastianfeldmann / phpbu

PHP Backup Utility - Creates and encrypts database and file backups, syncs your backups to other servers or cloud services and assists you monitor your backup process
https://phpbu.de
Other
1.29k stars 110 forks source link

Error with `xtrabackup8` source: `unknown argument` for target directory #370

Closed petecooper closed 5 months ago

petecooper commented 6 months ago

Hello. I'm running an hourly backup job with mysqldump and xtrabackup sources. The xtrabackup source throws an error, while the mysqldump source completes successfully. The backup job runs as root.

It may be that the target directory needs a --target-dir prepended so the argument is recognised.

This is my syntax:

        <backup name="dbname database xtrabackup gzip 10-hourly">
            <source type="xtrabackup8">
                <option name="databases" value="dbname" />
                <option name="host" value="127.0.0.1" />
                <option name="password" value="dbpass"/>
                <option name="user" value="dbuser" />
            </source>
            <target dirname="/mnt/turtle_backups_01/backups/phpbu/textpattern.com/forum/10-hourly/database/" filename="forum.textpattern.com_xtrabackup_10-hourly_%Y%m%d%H%i%s.sql" compress="gzip" />
            <cleanup type="quantity">
                <option name="amount" value="72" />
            </cleanup>
        </backup>

This is the output.

phpbu 6.0.20 by Sebastian Feldmann and contributors.

Time: 27 seconds, Memory: 8.43MB

Exception 'RuntimeException' with message 'Command failed:
  exit-code: 1
  message:   2024-03-04T12:28:01.355480-00:00 0 [Note] [MY-011825] [Xtrabackup] recognized server arguments: --datadir=/var/lib/mysql 
2024-03-04T12:28:01.356375-00:00 0 [Note] [MY-011825] [Xtrabackup] recognized client arguments: --backup=1 --user=dbuser --password=* --host=127.0.0.1 --databases=dbname 
2024-03-04T12:28:01.356435-00:00 0 [ERROR] [MY-011825] [Xtrabackup] unknown argument: '/mnt/turtle_backups_01/backups/phpbu/textpattern.com/forum/10-hourly/database/dump'

'
in phar:///opt/phpbu/phpbu.phar/lib/sf-cli/Command/Runner/Simple.php:61

FAILURE!
Backups: 5, failed Checks: 0, failed Crypts: 0, failed Syncs: 0, failed Cleanups: 0.

I would be grateful for any guidance. Thank you.

veebkolm commented 5 months ago

Doesn't work for me, too. It seems that the Executable wrapper does not add --target-dir before the backup target directory argument.

See https://docs.percona.com/percona-xtrabackup/innovation-release/create-full-backup.html

petecooper commented 5 months ago

Addressed by https://github.com/sebastianfeldmann/phpbu/pull/371