Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Var at 90%

Status
Not open for further replies.

call

Technical User
Oct 31, 2000
127
0
0
US
Here is my problem
Var 90% no more room to add space getting rid for the system soon can I deleted everything in var/tmp directory

drwxrwxrwt 2 bin bin 2048 May 20 09:25 .
drwxr-xr-x 12 bin bin 512 Sep 06 1997 ..
-rw-rw---- 1 root system 20128584 May 19 08:28 Ex22680

the file Ex22680 is the file I want to get rid of.
and is their any other file I can deleted I did the stander ones but not sure if their are other file I can get rid of
hiding somewhere.

thanks
 
I don't think I would get rid of that file. This is a tmp file that your system editor writes when someone opens a file. If you get rid of it, I don't know what will happen, but another will be created as soon as someone opens another file.

Here are my suggestions:

in /var, do a du -sk * | sort -n. This will give you a listing of the sizes of all the files and directories in /var, sorted with the largest last. Then go through the directories and try pruning them.

Check for any core files that may be in /var. You could stop syslog, remove the current syslog in /var/adm/ras, create a new one and restart the syslog daemon. This would help if you syslog file is very large right now.

You said you had deleted the standard ones. Could you be more specific?
 
check the spooler files
it could be old print jobs that have not been deleted
/var/spool/lps
 
Look for the following files :

/var/adm/wtmp
If the size is big and u need the data simply take a backup of the file and initialize the file by. Write "> wtmp" to turn the file into 0 byte.

/var/adm/sulog
do same as wtmp ...

Check for old tempoary files created by editors in /var/preserve. If there are such files simply delete the files of old dates.

Best Regards,
vivek
 
Thank everybody, I have enough space now. The system is only going to be up for 1 more month I should be ok.

thanks again.
 
call: there is one more thing to take care of while deleting files from /var

As this is the standard place of files that regularly changes, many files are kept open continuously. Thus check if file to be delete is not open already.

The standard Unix behaviour on deleting open files is to remove inode entry, but keeping file handle and the file itself. The actual deletion happens when all process releases file handle.
This means that if there is a BIIIIG log file, and you simply delete it with rm, you will not get back the filesystem space until logger program closes te file.

For this reason you should always truncate log files and not delete. File truncate can be done for example as follows:
cat /dev/null > FILE_TO_BE_TRUNCATED

--Trifo
 
`cat` merely reflects stdin and stdout. cat is just echoing a file (/dev/null) onto stdout since you are giving that as an argument.

This is really zeroing out a file, whereas truncating sets the length of a file.
 
AIXSPadmin: OK, that's right. My solution is emptying the file. Also it was the goal for now.

Can you suggest any better to keep some content from the end of log while getting rid of the rest?

--Trifo
 
What is the command to delete first 100 lines and leave last 7-10 lines from a files.sometimes the file size grows and i will not be able to view the contents of file in vi editor it gives error message not enough memory.

thanx in advance

regards
arvind
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top