[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 »

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.
Deleted User 11865

Re: Changing temp file location

Post by Deleted User 11865 »

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 »

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: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Changing temp file location

Post by Woodstock »

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 »

It worked, Woodstock! I had to use .profile, but same difference.
Thanks!
mod16
Experienced
Posts: 78
Joined: Sun Jan 12, 2014 11:10 am

Re: [SOLVED] Changing temp file location

Post by mod16 »

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