1828623 Members
1295 Online
109983 Solutions
New Discussion

Re: files in /tmp

 

files in /tmp

I have a number of files in the /tmp directory in the format pga45769, where the 3rd letter and the numbers are random. Some are created by application users and others by root. Does anyone know how these are created?
5 REPLIES 5
John Palmer
Honored Contributor

Re: files in /tmp

It's likely they are from 'pg'. The man pages for pg say that it creates a file with this name in /tmp when input is from a pipe.

It does seem to tidy them up when you exit however.

Regards,
John
John Palmer
Honored Contributor

Re: files in /tmp

Some further information...

The 'random number' will be the process number of the pg command. This is a standard UNIX technique for ensuring that unique filenames are used in common directories like /tmp/ and /var/tmp.

Regards,
John
Paula J Frazer-Campbell
Honored Contributor

Re: files in /tmp

Hi
/tmp is used by the system and applications as a tempory storage area and applications use a predefined format for their tmp files ie. fredxxxxxx. The application will normally use the next number free when writing out its tmp file.

Some apps are very good in clearing up behind them and will remove the temp files that they create, whereas others are very untidy.

The following script will clean up files and dirs older that 7 days in the /tmp dir - I run it from cron once a day.

-----------------cut here --------------
# Clear /tmp files and dirs unused for over 7 days
find /tmp -type f -atime +7 -exec rm {} \;
find /tmp -type d -atime +7 -exec rmdir {} \;
----------------cut here -----------------

HTH

Paula
If you can spell SysAdmin then you is one - anon
Tracey
Trusted Contributor

Re: files in /tmp

I get similiar files generated from my Database system Ingres. In the II_TEMP directory of ingres it will create temporary files for use during queries; however if that use loses his connection, the temp files are usually left hanging around. From time to time I just delete them.
John Bolene
Honored Contributor

Re: files in /tmp

Xterm errors also go to /tmp.
After looking to see if I can determine problems, they are history.

/tmp is used for piped files as everything in UNIX is a file.

The only file I leave is the llbdbase.dat file which is a temp file used by the license broker.
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com