---
title: How to Run a Streaming Backup with innobackupex
description: We often need to run XtraBackup as a regular OS user. Our main issues are with permissions when a streaming backup. Here's the innobackupex command we use.
---

[Blog | Pythian ](https://www.pythian.com/blog)

# [How to Run a Streaming Backup with innobackupex](https://www.pythian.com/blog/how-to-run-a-streaming-backup-with-innobackupex)

 Written by [Pythian Marketing](https://www.pythian.com/blog/author/pythian-marketing) | Aug 2, 2011 4:00:00 AM

On many of our clients, we have a need to run[ XtraBackup](https://www.percona.com/software/percona-xtrabackup/) as a regular OS user. Aside from running into the issue where tar4ibd was not provided with Percona’s xtrabackup-1.6.2.tar.gz package, our main issues have been with permissions when attempting a streaming backup.

## I have found the following:

1. The user needs permissions for a temp directory to stream to/from. The my.cnf of the target database cannot be used because the user does not have permission to write to /tmp/mysql-stdout, so we set a tmpdir in a separate defaults-file.
2. A backup target directory must be used that the user has read/write permissions to. It seems to me a target directory should not be needed for a streaming backup, but it is.
3. A user who has SUPER privileges must be used to connect to the target database.
4. Group and datadir permissions:

- The primary group for the user should be the same as the mysql user running the target database, i.e. pythian:mysql.
- The user must have 770 access to the database schema directories.
- The user must have 740 access to the all files under the mysql datadir.

## Here is the innobackupex command that works for us.

```
$ innobackupex --defaults-file=/home/pythian/my.cnf --user=root --stream=tar ./ | gzip - > /home/pythian/backups/2011-08-02_backup.tar.gz
```

So if you are seeing errors such as,

```
tar: -: Cannot write: Broken pipe
sh: /tmp/mysql-stout: Permission denied
```

do yourself a favor and run through this permission checklist. I hope it saves a lot of headaches.

## MySQL Database Consulting Services

Ready to optimize your MySQL Database for the future?

[View full post](https://www.pythian.com/blog/how-to-run-a-streaming-backup-with-innobackupex)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Pythian Marketing"
  },
  "dateModified" : "2026-04-15T16:23:13.779Z",
  "datePublished" : "2011-08-02T04:00:00Z",
  "headline" : "How to Run a Streaming Backup with innobackupex",
  "image" : {
    "@type" : "ImageObject",
    "height" : 60,
    "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
    "width" : 60
  },
  "mainEntityOfPage" : "https://www.pythian.com/blog/how-to-run-a-streaming-backup-with-innobackupex",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Pythian Blog"
  }
}
```