# SST XtraDB Backup - Use a different tmp directory

**URL:** <https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [February 28, 2017, 7:00am UTC](https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453 "2017-02-28T07:00:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![weishan](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@weishan](https://forums.percona.com/u/weishan)\
**Post date:** [February 28, 2017, 7:00am UTC](https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453/1 "2017-02-28T07:00:29Z")

</div>

Hi all,

Our current tmp directory is only 5GB and it’s not able to perform SST backup as the tmp directory gets filled up really quickly.

Setting tmpdir under [mysqld] or [xtrabackup] doesn’t work for me. I have also checked the permissions. It is still using /tmp for the SST.

We are using the following version:

Server version: 5.7.16-10-57-log Percona XtraDB Cluster (GPL), Release rel10, Revision bec0879, WSREP version 27.19, wsrep\_27.19

Any ideas please?

Thanks!

---

<div class="post-metadata">

**Author:** ![Kenn\_Takara](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@Kenn\_Takara](https://forums.percona.com/u/Kenn_Takara)\
**Post date:** [March 1, 2017, 10:05pm UTC](https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453/2 "2017-03-01T22:05:08Z")

</div>

Currently, in PXC 5.7, the tmpdir parameter doesn’t do very much for xtrabackup-v2 SST (changes the location of some temporary files used by the script)

To change the location of the backup files, as a workaround, you can manually edit the wsrep\_sst\_xtrabackup-v2 script

change the line (around line 1127)  
itmpdir=$(mktemp -d)  
to  
itmpdir=/path/to/your/temp/file

---

<div class="post-metadata">

**Author:** ![weishan](https://avatars.discourse-cdn.com/v4/letter/w/c0e974/32.png) [@weishan](https://forums.percona.com/u/weishan)\
**Post date:** [March 6, 2017, 6:51am UTC](https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453/3 "2017-03-06T06:51:51Z")

</div>

Thanks, that works!

---

<div class="post-metadata">

**Author:** ![marianourroz](https://avatars.discourse-cdn.com/v4/letter/m/ce73a5/32.png) [@marianourroz](https://forums.percona.com/u/marianourroz)\
**Post date:** [March 23, 2017, 1:48pm UTC](https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453/4 "2017-03-23T13:48:47Z")

</div>

Hi,  
another option set the TMPDIR on the top of the script:

edit wsrep\_sst\_xtrabackup-v2 and add

export TMPDIR=/mysql/sst\_ist\_stage

later, you will se the change on the script:

WSREP\_SST: [INFO] Streaming with xbstream (20170323 16:11:51.102)  
WSREP\_SST: [INFO] Using socat as streamer (20170323 16:11:51.105)  
WSREP\_SST: [INFO] Using /mysql/sst\_ist\_stage/tmp.LxzmCD7EUA as xtrabackup temporary directory (20170323 16:11:51.126)  
WSREP\_SST: [INFO] Using /mysql/sst\_ist\_stage/tmp.yPp4ONZAvD as innobackupex temporary directory (20170323 16:11:51.130)

thanks,  
regards  
Mariano

---

<div class="post-metadata">

**Author:** ![Kenn\_Takara](https://avatars.discourse-cdn.com/v4/letter/k/b2d939/32.png) [@Kenn\_Takara](https://forums.percona.com/u/Kenn_Takara)\
**Post date:** [April 19, 2017, 8:42pm UTC](https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453/5 "2017-04-19T20:42:25Z")

</div>

The fixes for this has just been released for PXC 5.6 and 5.7:

[url][https://www.percona.com/blog/2017/04/19/percona-xtradb-cluster-5-6-35-26-20-3-now-available/[/url]](https://www.percona.com/blog/2017/04/19/percona-xtradb-cluster-5-6-35-26-20-3-now-available/%5B/url%5D)  
[url][https://www.percona.com/blog/2017/04/19/percona-xtradb-cluster-5-7-17-29-20-now-available/[/url]](https://www.percona.com/blog/2017/04/19/percona-xtradb-cluster-5-7-17-29-20-now-available/%5B/url%5D)

PXC will now check for and use the tmpdir option.

---

<div class="post-metadata">

**Author:** ![danarashad](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@danarashad](https://forums.percona.com/u/danarashad)\
**Post date:** [December 15, 2021, 3:26pm UTC](https://forums.percona.com/t/sst-xtradb-backup-use-a-different-tmp-directory/5453/6 "2021-12-15T15:26:41Z")

</div>

I think you have to set the tmpdir in the sst section in the .cnf file  
[sst]  
tmpdir=/location
