Operating System - HP-UX
1832177 Members
3008 Online
110038 Solutions
New Discussion

Re: eliminate file creation like eaaa11785 in /var/tmp

 
Jonathan Corbeill
Occasional Advisor

eliminate file creation like eaaa11785 in /var/tmp

I have a K420 running HPUX 10.20.

Ever since I have been responsible for the system I have had to periodically remove what appears to be temporary files from the /var/tmp directory. Below is a sample list of the files:

-rw-rw-rw- 1 294 fpu 12 Jul 10 09:55 eaaa11643
-rw-rw-rw- 1 grimm mpu 12 Aug 17 16:42 eaaa11652
-rw-rw-rw- 1 rff frf 12 Aug 16 11:36 eaaa11653
-rw-rw-rw- 1 hafley mpu 12 Jul 12 02:25 eaaa11718
-rw-rw-rw- 1 layow fpu 12 Aug 8 14:37 eaaa11721
-rw-rw-rw- 1 ohler mpu 12 Aug 17 09:43 eaaa11734
-rw-rw-rw- 1 grimm mpu 12 Aug 17 16:44 eaaa11753
-rw-rw-rw- 1 rff frf 12 Jul 26 15:58 eaaa11760

Each one is relatively small. The files can be removed, but not in a normal wildcard fashion. "rm e*" returns an error stating there are too many files, but thats a different issue. Suffice to say that I remove them with more refined wildcard rm statements like "rm eaa*".

My real question is not how to delete the files, but how to prevent them from being created.... Whats creating them and how can I have it stop.

A sample file content is:
^[*c0F^[&f6X^[E

:)~
6 REPLIES 6
John Palmer
Honored Contributor

Re: eliminate file creation like eaaa11785 in /var/tmp

Jonathan,

These sound like temporary files (logs or similar) being created by an application that you run.

I wouldn't mind betting that the number on the end of the filename relates to the process number that created them.

Try doing a ls -lt|more on the directory now, pick the newest and check out the process number from the filename.

You probably won't be able to stop them being created but you could install a daily housekeeping script to delete them - use find with the mtime argument.

Regards,
John
Andy Monks
Honored Contributor

Re: eliminate file creation like eaaa11785 in /var/tmp

Basically, applications/executable/shells all create temporary files. They should clear up after themselfs, but if they die they obviously don't and some just don't.

You could run a cron job to remove ones older than a day every night or similiar.
Kofi ARTHIABAH
Honored Contributor

Re: eliminate file creation like eaaa11785 in /var/tmp

You could tie the temporary file removal as part of your backups, because I assume that you shut down all applications prior to backups, (so there is no chance that the files are in use at the time)... you could add a line like:
find /var/tmp/ -name "ea*" -exec rm {} \;
to your backup scripts
nothing wrong with me that a few lines of code cannot fix!
James Odak
Valued Contributor

Re: eliminate file creation like eaaa11785 in /var/tmp

Well i used to have the same problem
i had thought they were created by ip printing
but i do no think it is posible to stop them from creating unless you go into the heart of unix code
a nightly or even hourly cron cleaning them up would be my best suggestion as well

if you find it is print jobs that are creating them you can check your interface files and/or printer settings ...
adding sleep commands helped a little
on some printer applications there is an option to delete temp files after printing
beware tho, if a printer job hangs, this causes it to be lost

anyways hope this helps
Cheryl Griffin
Honored Contributor

Re: eliminate file creation like eaaa11785 in /var/tmp

You can use the file command to see what application or command created the file. Also using the strings command may help to look at the contents.

/var/tmp is used by many applications and should be cleaned out frequently. The easiest way to keep this directory clear is to use a cron script to automatically remove the files.

# file AAAa23547
ascii text

# strings AAAa23547
======= 08/07/00 12:35:46 EDT BEGIN swinstall SESSION (interactive)
NOTE: The interactive UI was invoked, since no software was
specified.

* Session started for user "root@rong".

* Beginning Selection
======= 08/07/00 12:36:26 EDT END swinstall SESSION (interactive)

As you can see swinstall or swagentd caused this file.
"Downtime is a Crime."
Antoanetta Naghiu
Esteemed Contributor

Re: eliminate file creation like eaaa11785 in /var/tmp

You might know this: You can make a link from /var/tmp to /tmp. And also, if you edit /etc/rc.config.d/clean_tmps to have LIST_TEMPS=0 and CLEAR_TMP=1, at reboot time, instead of listing the files from tmp it will perform a clean up (delete).