Link to home
Avatar of chalie001
chalie001

asked on

temp file linux

hi how can i configure the temp folder
i what my  /usr1, /usr2, /usr3 path to poin to /temp with 10gib

Filesystem                 Size  Used Avail Use% Mounted on
devtmpfs                   3.8G     0  3.8G   0% /dev
tmpfs                      3.8G     0  3.8G   0% /dev/shm
tmpfs                      3.8G  8.9M  3.8G   1% /run
tmpfs                      3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/mapper/app_zone-root   10G  4.6G  5.5G  46% /
/dev/mapper/app_zone-temp   10G   33M   10G   1% /temp
/dev/mapper/app_zone-usr2   30G   33M   30G   1% /usr2
/dev/mapper/app_zone-usr3   30G   33M   30G   1% /usr3
/dev/mapper/app_zone-usr1  120G   33M  120G   1% /usr1
/dev/mapper/app_zone-var    10G  2.7G  7.4G  27% /var
/dev/mapper/app_zone-home   10G   47M   10G   1% /home
/dev/sda2                   10G  219M  9.8G   3% /boot
tmpfs                      773M   16K  773M   1% /run/user/1000
/dev/sr0                    82M   82M     0 100% /run/media/calapp/VBox_GAs_6.0.
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Slightly expanding noci's solution.

Just be sure to set $TEMP + $TMPDIR globally somewhere, like /etc/environment or however your Distro manages global environment variables.

Remember, likely a reboot will be required for /etc/environment to be read by every running process.
based on comment from noci
export TEMP=/temp
export TMPDIR=/temp

Open in new window

write above statements in
~/.bashrc
or ~/.bash_profile file for making them permanent for required users.
>> Comment from David Facor
use /etc/environment file if required to set for all users. => require root or sudo access
Whether you use ~/.* files or environment files + how exactly you approach all this depends on...

1) Do you require these variables being set only for interactive shells.

2) Do you require these variables being set for all shells (including background/batch/CRON) initiated shells.

Really best to start by answering these 2x questions, choosing a solution matching your answer.