# tmp dir confusion

**URL:** https://forums.percona.com/t/tmp-dir-confusion/5491
**Category:** Percona XtraBackup
**Created:** [March 17, 2017, 8:09pm UTC](https://forums.percona.com/t/tmp-dir-confusion/5491 "2017-03-17T20:09:38Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![booger](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@booger](https://forums.percona.com/u/booger)
#### Post date: [March 17, 2017, 8:09pm UTC](https://forums.percona.com/t/tmp-dir-confusion/5491/1 "2017-03-17T20:09:38Z")

</div>

Hi, If I am using innobackup with xbstream to backup to an nfs mount is it better to use a local temp dir or a dir on the nfs mount? ie if  
/nfs is destination nfs mount should I use

innobackupex --xbstream /tmp \> /nfs/backup.xbstream  
or  
innobackupex --xbstream /nfs \> /nfs/backup.xbstream

---

<div class="post-metadata">

### Author: ![jrivera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jrivera/32/13_2.png) [@jrivera](https://forums.percona.com/u/jrivera)
#### Post date: [March 17, 2017, 8:17pm UTC](https://forums.percona.com/t/tmp-dir-confusion/5491/2 "2017-03-17T20:17:03Z")

</div>

The command should be

```auto
--stream=xbstream

```

[url][https://www.percona.com/doc/percona-xtrabackup/2.4/howtos/recipes\_ibkx\_stream.html[/url]](https://www.percona.com/doc/percona-xtrabackup/2.4/howtos/recipes_ibkx_stream.html%5B/url%5D)

But to avoid problems when you hit connection issues with your NFS at the time of a backup, we tend to recommend to backup to your local drive and the cp the backup to the NFS after

```auto
innobackupex --stream=xbstream ./ > /path/to/local/backup_dir/backup.xbstream

```

Once backup completes, mv or cp the file to the NFS mount

---

<div class="post-metadata">

### Author: ![booger](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@booger](https://forums.percona.com/u/booger)
#### Post date: [March 17, 2017, 9:04pm UTC](https://forums.percona.com/t/tmp-dir-confusion/5491/3 "2017-03-17T21:04:30Z")

</div>

thanks, so with the command you provided the backup is initially written to ./ and then “tarred” and moved to /path/to/local/backup\_dir/backup.xbstream?

---

<div class="post-metadata">

### Author: ![jrivera](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jrivera/32/13_2.png) [@jrivera](https://forums.percona.com/u/jrivera)
#### Post date: [March 17, 2017, 9:06pm UTC](https://forums.percona.com/t/tmp-dir-confusion/5491/4 "2017-03-17T21:06:40Z")

</div>

Yes, if you want you can specify it:

```auto
innobackupex --stream=xbstream /tmp > /path/to/local/backup_dir/backup.xbstream

```

This way temporary files are created in the /tmp directory.

---

<div class="post-metadata">

### Author: ![booger](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@booger](https://forums.percona.com/u/booger)
#### Post date: [March 17, 2017, 9:48pm UTC](https://forums.percona.com/t/tmp-dir-confusion/5491/5 "2017-03-17T21:48:34Z")

</div>

thx, I guess it just seems odd that you need to specify a temp dir to stream to stdout
