# MySQL/MariaDB Backup to S3 is not working while using xtrabackup feature

**URL:** <https://forums.percona.com/t/mysql-mariadb-backup-to-s3-is-not-working-while-using-xtrabackup-feature/8135>\
**Category:** Percona XtraBackup\
**Created:** [October 14, 2020, 2:11am UTC](https://forums.percona.com/t/mysql-mariadb-backup-to-s3-is-not-working-while-using-xtrabackup-feature/8135 "2020-10-14T02:11:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiranmk](https://avatars.discourse-cdn.com/v4/letter/k/13edae/32.png) [@kiranmk](https://forums.percona.com/u/kiranmk)\
**Post date:** [October 14, 2020, 2:11am UTC](https://forums.percona.com/t/mysql-mariadb-backup-to-s3-is-not-working-while-using-xtrabackup-feature/8135/1 "2020-10-14T02:11:41Z")

</div>

xtrabackup --backup --stream=xbstream --extra-lsndir=/tmp --target-dir=/tmp | xbcloud put --storage=s3 --s3-endpoint=‘[s3.amazonaws.com](http://s3.amazonaws.com)’ --s3-access-key=‘XXXXXXXXXXX’ --s3-secret-key=‘YYYYYYYYYYYYYYY’ --s3-bucket=‘abcd’ --parallel=10 ${date -I}-full\_backup

-bash: ${date -I}-tk-full\_backup: bad substitution

xtrabackup: recognized server arguments: --datadir=/var/lib/mysql

xtrabackup: recognized client arguments: --backup=1 --stream=xbstream --extra-lsndir=/tmp --target-dir=/tmp

201014 07:28:35 version\_check Connecting to MySQL server with DSN ‘dbi:mysql:;mysql\_read\_default\_group=xtrabackup’ (using password: NO).

201014 07:28:35 version\_check Connected to MySQL server

201014 07:28:35 version\_check Executing a version check against the server…

201014 07:28:35 version\_check Done.

201014 07:28:35 Connecting to MySQL server host: localhost, user: not set, password: not set, port: not set, socket: not set

Using server version 5.5.65-MariaDB

xtrabackup version 2.4.20 based on MySQL server 5.7.26 Linux (x86\_64) (revision id: c8b4056)

xtrabackup: uses posix\_fadvise().

xtrabackup: cd to /var/lib/mysql

xtrabackup: open files limit requested 0, set to 32768

xtrabackup: using the following InnoDB configuration:

xtrabackup: innodb\_data\_home\_dir = .

xtrabackup: innodb\_data\_file\_path = ibdata1:10M:autoextend

xtrabackup: innodb\_log\_group\_home\_dir = ./

xtrabackup: innodb\_log\_files\_in\_group = 2

xtrabackup: innodb\_log\_file\_size = 5242880

InnoDB: Number of pools: 1

201014 07:28:35 \>\> log scanned up to (1597945)

xtrabackup: Generating a list of tablespaces

201014 07:28:35 [01] Streaming ./ibdata1

xtrabackup: Error writing file ‘UNOPENED’ (Errcode: 32 - Broken pipe)

xb\_stream\_write\_data() failed.

xtrabackup: Error writing file ‘UNOPENED’ (Errcode: 32 - Broken pipe)

[01] xtrabackup: Error: xtrabackup\_copy\_datafile() failed.

[01] xtrabackup: Error: failed to copy datafile.

201014 07:28:36 \>\> log scanned up to (1597945)

Best Regards,

Kiran.M.K.

---

<div class="post-metadata">

**Author:** ![Marcelo\_Altmann](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/marcelo_altmann/32/11299_2.png) [@Marcelo\_Altmann](https://forums.percona.com/u/Marcelo_Altmann)\
**Post date:** [October 26, 2020, 11:08am UTC](https://forums.percona.com/t/mysql-mariadb-backup-to-s3-is-not-working-while-using-xtrabackup-feature/8135/2 "2020-10-26T11:08:44Z")

</div>

Hi Kirian,

The issue is with the name you are giving to your backup. Have a look at your first line:

-bash: ${date -I}-tk-full\_backup: bad substitution

Try it as:

xtarbackup [options] | xbcloud [options] $(date ‘+%Y%m%d%H%M%S’)-full\_backup
