[SOLVED] Changing temp file location

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
CrimsonGhost
Posts: 3
Joined: Mon May 11, 2015 3:01 am

[SOLVED] Changing temp file location

Post by CrimsonGhost » Mon May 11, 2015 3:05 am

I am a new convert to linux and although I love it and am never going back, I am having some difficulties.
My file system partiton keeps filling up when I run handbrake. How can I change the location Handbrake uses for temp files to /home/$USER/temp instead of just /tmp?

Solved Edit:
This was the solution:
Woodstock wrote:If you are using the bash shell, in your home directory, there will be a file .bash_profile. (in my case it was .profile) Edit it to add this line:

Code: Select all

TMPDIR=~/temp
Once in place, the NEXT time you create a shell (or log in), the variable will be set, and handbrake should see it.
Last edited by CrimsonGhost on Mon May 11, 2015 1:27 pm, edited 1 time in total.

User avatar
Rodeo
HandBrake Team
Posts: 12160
Joined: Tue Mar 03, 2009 8:55 pm

Re: Changing temp file location

Post by Rodeo » Mon May 11, 2015 10:24 am

hb_get_temporary_directory() will honor $TMPDIR and $TEMP variables (the first takes precedence).

CrimsonGhost
Posts: 3
Joined: Mon May 11, 2015 3:01 am

Re: Changing temp file location

Post by CrimsonGhost » Mon May 11, 2015 12:21 pm

Rodeo wrote:hb_get_temporary_directory() will honor $TMPDIR and $TEMP variables (the first takes precedence).
ok, but how do I implement that? I'm using the gui, as I'm still very noob at CLI

Woodstock
Veteran User
Posts: 3186
Joined: Tue Aug 27, 2013 6:39 am

Re: Changing temp file location

Post by Woodstock » Mon May 11, 2015 12:57 pm

If you are using the bash shell, in your home directory, there will be a file .bash_profile. Edit it to add this line:

Code: Select all

TMPDIR=~/temp
Once in place, the NEXT time you create a shell (or log in), the variable will be set, and handbrake should see it.

CrimsonGhost
Posts: 3
Joined: Mon May 11, 2015 3:01 am

Re: Changing temp file location

Post by CrimsonGhost » Mon May 11, 2015 1:25 pm

It worked, Woodstock! I had to use .profile, but same difference.
Thanks!

mod16
Posts: 78
Joined: Sun Jan 12, 2014 11:10 am

Re: [SOLVED] Changing temp file location

Post by mod16 » Wed May 13, 2015 10:08 am

If you are using Ubuntu, the recommended file to add this variable would be ~/.pam_environment - but keep in mind that these are key=value pairs, so you need the full path, like: TMPDIR=/home/<yourUsername>/tmp

If you want this temp path only used by Handbrake, you also could launch the Handbrake GUI using a short script:

Code: Select all

#!/bin/bash

mkdir -p ~/.ghbtmp
TMPDIR=~/.ghbtmp ghb

Post Reply