Operating System - HP-UX
1834978 Members
2365 Online
110073 Solutions
New Discussion

Junk files in Root directory

 
SOLVED
Go to solution
Sanjay Kumar Suri
Honored Contributor

Junk files in Root directory

On one of our HP-UX 11.11 system installed last year, we found some junk files (say about 50 in the root file system). Sample of the same is attached.

All of these files are 0 bytes and are created on the same date (ls -l is attached).

How they have been created?
How they can be removed? Because what is display is differnt then what actually is?

I hope could clearly state my problem.

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
6 REPLIES 6
Michael Tully
Honored Contributor

Re: Junk files in Root directory

Apart from being extremely dangerous (permissions of 666) it is a little hard to read them ;) As far as creation goes, what was installed on June 2 2003 ? Perhaps a shoddy product install, run from the wrong place.

Perhaps move all files to a directory, move files back to / that should be there. Might be a good idea if you haven't already and move root's home directory to say /root
Anyone for a Mutiny ?
Ronald Cogen
Frequent Advisor

Re: Junk files in Root directory

It could be an application which is creating such files instead of sending them to /tmp. I once had a similar problem and found out that an application in connection with our Oracle data base was the culprit. In that case we were able to redirect it. In any event, there must be something out there sending flack. I sugggest that you go through all possible application related to data bases, network, user apps and make sure you know what kind of junk files are being created.

Ron
I've been down so long it looks like up to me
R. Allan Hicks
Trusted Contributor
Solution

Re: Junk files in Root directory

Never seen anything like that. Ron has a good point about the /tmp directory. Check your environments especially anything that might use oracle. TMP and TMPDIR should point to your /tmp directory

To remove them, I'd do

ls -l|awk '{printf "rm -f %s\n",$9}'>clean_up

_THEN_ edit clean_up _very_ _VERY_ carefully to make sure it only had the files that I wanted to remove. Maybe have a collegue check the file to make sure that you got it right.

chmod 700 clean_up

then ./clean_up and remove clean_up when I was done

rm -i * would work well too, but if you get punchy during the deletion of 50 files you might just hit the wrong one.

--Good Luck
"Only he who attempts the absurd is capable of achieving the impossible
Geoff Wild
Honored Contributor

Re: Junk files in Root directory

Wow - those are ugly...

Do you have a Windows box with a ftp client - like WSFTP?

I would ftp to that server, and see what the files look like - you might be able to delete with ftp.

The fact that there hasn't been a re-occurrance means they are not required.

They could have been created by someone by accidently cut'n'pasting some garbage on the command line...

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Philip Kernohan
Advisor

Re: Junk files in Root directory

Sanjay,

it looks like someones shell script went wrong but it's hard to say.

As if someone was trying to create a script that looped through a file and created sub-files or whatever and then accidently fed it a binary file.

I would look for whatever else was changed on that date that may give you a clue ...

find / -exec ll {} \; | grep 'Jun 2 2003'

I might not have the spaces correct in the grep there.

Hope you work it out. If they've been there for a year with no modifications, and the fact, that the other systems don't have them then I would try and remove them.

In cases like these I tend to find the ll that works and then make it an rm. Try an ll of the unusual chars ... ll '*[!@#$%^&*]*'

Regards,
PK
It's nice to be important but it's more important to be nice
MarkSyder
Honored Contributor

Re: Junk files in Root directory

Hi Sanjay,

I have a standard procedure for things like this:

1. Move the offending files to a directory called /safe.

2. If anyone screams that their job is failing because of a missing file, move it/them back.

3. If no one has screamed after a year, delete the files.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing