1847257 Members
4454 Online
110263 Solutions
New Discussion

Sorting problem

 
ramkumar
Valued Contributor

Sorting problem

Hi all

My application uses /var/tmp for sorting huge files (default location in HPUX). The number of files to be sorted is growing due to which I face a problem of having to increase space in /var frequetly. Is there any way to change the sort location from /var to any custom location if not then will there be any problem if I mount /var/tmp as a separate filesystem .
5 REPLIES 5
Dietmar Konermann
Honored Contributor

Re: Sorting problem

man sort(1):

-T dir Use dir as the directory for temporary scratch files
rather than the default directory, which is is one of
the following, tried in order: the directory as
specified in the TMPDIR environment variable;
/var/tmp, and finally, /tmp.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Peter Godron
Honored Contributor

Re: Sorting problem

ramkumar,
in addition to dietmar's solution, it slightly improves performance if you can use the -y option to maximise initial memory.
Regards
Devender Khatana
Honored Contributor

Re: Sorting problem

Hi Ramkumar,

As clarified you can define a seperate directory with -T options which has to be used as tmp directory. If you do not want to alter your command syntax then define directory you want to use in $TMPDIR variable.

HTH,
Devender
Impossible itself mentions "I m possible"
Peter Godron
Honored Contributor

Re: Sorting problem

Ramkumar,
is this problem resolved?
Thanks
T G Manikandan
Honored Contributor

Re: Sorting problem

Try using the env. variable TMPDIR pointing to a different directory.

TMPDIR=/tmp