1834594 Members
3814 Online
110069 Solutions
New Discussion

Re: cleaning /var

 
SOLVED
Go to solution
Jorge Prado_1
Advisor

cleaning /var

Hi,

What importance have the files stored in /var/preserve folder?
Can I erase the old files?

My server: N-class, hp-ux 11.00.

Thanks in advance.
Jorge Prado
4 REPLIES 4
Pete Randall
Outstanding Contributor
Solution

Re: cleaning /var

Jorge,

If I recall correctly, these are old editor save files and can be safely removed, though you might want to save the more recent ones. Try something like:

find /var/preserve -type f -mtime +7 -exec rm {} \;

You could also put that in cron to run daily or weekly.


Pete

Pete
RAC_1
Honored Contributor

Re: cleaning /var

The files in that dir, are vi editor files. When editor cashed, had problems, the contents will be put there for recovery. You can check files with cat/strings and if you do not want, you can delete it.
There is no substitute to HARDWORK
Elmar P. Kolkman
Honored Contributor

Re: cleaning /var

/var/preserve contains files that were opened with vi (and the like) that were open during a crash of your terminal session.
By issuing vi -r on the file being edited, the file in /var/preserve is used to do the changes that were not saved yet. Mind that the changes recorded there are against the file at the time of the 'crash', not the current version which might be newer. And the last actions before the crash might be lost, because the file is not in sync with your editing.

So, if no one is interested in this, you might remove all files. Or only files older then a certain amount of time.
Every problem has at least one solution. Only some solutions are harder to find.
Robert-Jan Goossens
Honored Contributor

Re: cleaning /var

Jorge,

/var/preserve (formerly /usr/preserve) contains automatically
preserved vi files. These files can be deleted whenever necessary.

The white paper associated with the description of this directory
is located at /usr/share/doc/file_sys.txt.

Regards,
Robert-Jan