what is creating the files in /tmp


 
Thread Tools Search this Thread
Operating Systems AIX what is creating the files in /tmp
# 1  
Old 11-13-2008
what is creating the files in /tmp

How do I find what is creating these bunch of zero byte files under /tmp directory every few minutes.

AIX - 5.3 TL05

# ls -l /tmp
-rw-r--r-- 1 root system 0 Nov 05 16:54 n83n7a
-rw-r--r-- 1 root system 0 Nov 05 16:54 ZO3S7a
-rw-r--r-- 1 root system 0 Nov 05 16:54 58w8ya
-rw-r--r-- 1 root system 0 Nov 05 16:53 oVul7a
-rw-r--r-- 1 root system 0 Nov 05 16:49 iN3h7a
-rw-r--r-- 1 root system 0 Nov 05 16:45 rL9oUa
-rw-r--r-- 1 root system 0 Nov 05 16:45 ch5lEa
# 2  
Old 11-14-2008
Probably the (interactive) shells are doing this. If you enter a long (multiline) command like a for-loop, a while-loop, etc. shells create temporary files they sometimes "forget" to delete. Over time these files accumulate.

Other programs oftenly do the same. For instance the /tmp directory of one of my machines looks like this (part of it - rest snipped):

Code:
-rw-rw-r--   1 root     admin          1833 Oct 23 11:21 aaaHxubqa
-rw-rw-r--   1 root     admin          1833 Oct 23 11:21 aaaIDYiEa
-rw-rw-r--   1 root     admin          1833 Oct 23 11:21 aaaIG7jaa
-rw-rw-r--   1 root     admin          1833 Oct 23 11:21 aaaIL3nya
-rw-rw-r--   1 root     admin          1833 Oct 23 11:21 aaaILabEa
-rw-r-----   1 xlcuser staff            360 Oct 28 09:58 xlcLD3JUaMf
-rw-r-----   1 xlcuser staff            360 Oct 27 13:31 xlcLD3Laeaf
-rw-r-----   1 xlcuser staff            363 Nov 04 16:39 xlcLD4HYiaf
-rw-r-----   1 xlcuser staff            360 Oct 27 13:31 xlcLD4Haeif
-rw-r-----   1 xlcuser staff            360 Oct 28 09:58 xlcLD4IUaUf
-rw-r-----   1 xlcuser staff            363 Oct 27 13:30 xlcLD4oIhaf
-rw-r-----   1 xlcuser staff            363 Nov 04 16:53 xlcLD5D3myf
-rw-r-----   1 xlcuser staff            363 Oct 28 09:58 xlcLD5hUiUf

The first group is from shell processes, the second group is from xlc.

Delete them if they bother you. You could do it from cron with a "find .... -exec rm ..." or configure skulker to go after them.

I hope this helps.

bakunin
# 3  
Old 11-15-2008
Thanks for your response but I just don't want to delete files because there are like quite a bunch of files (owned by root/system) created every other day and I'm afraid of deleting that might be related to some application/OS even though its in /tmp which usually have files that are not really important.

Anyways I'm trying to find where these files are being generated from and for this I'm looking at the option of setting up 'audit' mode, keep you guys posted.

Thanks again.
# 4  
Old 11-17-2008
Quote:
Originally Posted by mbak
I'm afraid of deleting that might be related to some application/OS
Now the following has nothing to do with the problem directly, but:

Whatever is placed in /tmp is supposed to br deleted after some time (usually 24 hours). This is what /tmp is for.

Many systems have automatic deletion of the contents of /tmp based on this rule (created more than 24h ago) and whoever puts data in /tmp should be aware that such a rule might be in place. If someone loses valuable data because placing it in /tmp and nowhere else its his fault, not the fault of the systems administrator keeping the machine clean. Its like throwing away some valuable paper on the street and then complaining about the street-cleaning doing its job because it isn't there any more a week later.

You might want to educate your users better.

bakunin
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Can all files under /tmp be safely removed

I wanted to know whether all files under /tmp can be safely removed. I guess that /tmp may also have temporary files for applications currently being worked on, so at the most those applications may just shut down. I hope that my question is clear whether all files under /tmp can be safely... (5 Replies)
Discussion started by: RHCE
5 Replies

2. UNIX for Dummies Questions & Answers

Redirecting tmp files of SORT into different directory

Hey Guys, I am facing an annoying scenario, fewer times when I execute the sort command, it throws out on error saying that "No Space on available on /var/tmp/<temp file name>. May be it is set to /var/tmp directory. I was wondering, if I cant redirect the temporary file creation to any other... (3 Replies)
Discussion started by: abhisheksunkari
3 Replies

3. AIX

Unknown files in /tmp

I have a lot of files with the following names in /etc /tmp/<num>.mktcpip like /tmp/934030.mktcpip Anyone knows which process creates these files? (1 Reply)
Discussion started by: petervg
1 Replies

4. UNIX for Dummies Questions & Answers

ls or find files under /tmp/*

what is proper syntax to ls all files under /tmp/*, and wc -c ? (4 Replies)
Discussion started by: tjmannonline
4 Replies

5. Shell Programming and Scripting

I need to make a script to delete files not in use in /tmp

I need to make a script to delete files not in use in /tmp Thanks! (4 Replies)
Discussion started by: raulochi
4 Replies

6. Shell Programming and Scripting

how to pin files to /tmp

Hi all, Am currently working on editing a startup script that need me to copy a certain file from cdrom to /tmp (its a live cd am working on)and mount if from there to certain place.. Now i know that nothing can be stored in /tmp permanently ,however mechanism to load the file to /tmp on... (19 Replies)
Discussion started by: wrapster
19 Replies

7. Solaris

How to save files in /tmp????

Hi all, I would like to know how to save files in /tmp... I was interested in knowing this because when ever i booted into solaris there would already be a few files present in /tmp.however any file that is freshly stored in would be lost on reboot... can anyone answer this pls!! (3 Replies)
Discussion started by: wrapster
3 Replies

8. AIX

set permission to files in /tmp

Trying to setup user to have the ability to delete any files (regardless of owner) in /tmp. I've tried almost everything... the permission on the folder is drwxrwxrwt 10 bin bin, and at one point I give all the possible permission (short of root) I can give to the user, and he still can't delete... (2 Replies)
Discussion started by: cchiang12
2 Replies

9. Shell Programming and Scripting

K shell /tmp/sh$$.* files problem

Hi, I am encountring this problem from some time now... ksh creates temp files /tmp/sh$$.* . Sometimes if some of my shell script crashes or I kill it... these temp files remain in the /tmp directory. At some later time when some script gets the same PID it tries to create files in the... (5 Replies)
Discussion started by: amitkr
5 Replies

10. UNIX for Dummies Questions & Answers

monitoring /tmp and /var/tmp for suspicous activity

Hello, does anyone have a script that can check the contents of the /tmp directory and for example e-mail the directory content if anything other than session files are present? Maybe there are better ways to monitor suspicous /tmp and /var/tmp activity, if so I'm listening :) (1 Reply)
Discussion started by: jamesbond
1 Replies
Login or Register to Ask a Question