Linux /tmp and /var housekeeping recommendations

2004-12-12 Thread Peter E. Abresch Jr. - at Pepco

I was planning to perform some housekeeping cleanup on a regular basis for
/tmp by including the following command in a cron:

find /tmp -atime +30 -type f -print0 | xargs -0 rm

I was going to do the same for the /var directory and got to thinking that
maybe I will get more than I bargain for. What is everyoneâs opinion about
removing all files that have not been accessed in 30 days for directory
/var? Am I being over zealous?

What about directories? Should I remove empty directories within /tmp and
/var using a command like?:

find /tmp âempty -type d -print0 | xargs -0 rmdir

I welcome all comments. Thanks.

Peter


This Email message and any attachment may contain information that is
proprietary, legally privileged, confidential and/or subject to copyright
belonging to Pepco Holdings, Inc. or its affiliates ("PHI").  This Email is
intended solely for the use of the person(s) to which it is addressed.  If
you are not an intended recipient, or the employee or agent responsible for
delivery of this Email to the intended recipient(s), you are hereby
notified that any dissemination, distribution or copying of this Email is
strictly prohibited.  If you have received this message in error, please
immediately notify the sender and permanently delete this Email and any
copies.  PHI policies expressly prohibit employees from making defamatory
or offensive statements and infringing any copyright or any other legal
right by Email communication.  PHI will not accept any liability in respect
of such communications.

Re: Linux /tmp and /var housekeeping recommendations

2004-12-12 Thread Tom Shilson





Some *nix systems clean /tmp on every reboot and I have been considering
making that part of our startup.  Our /tmp does not fill up much even after
a month so it is not that big a deal. I was thinking of making /tmp a
separate virtual file system like swap.

I agree with Mark on /var.  You may want to consider it on a file by file
basis.

tom
- - - - - - - - - - - -
Toto, I have a feeling we're not in the mainframe world any more.
   _/)  Tom Shilson
~GEDW & VM System Services
Aloha   Tel:  651-733-7591   tshilson at mmm dot com
   Fax:  651-736-7689

Linux on 390 Port <[EMAIL PROTECTED]> wrote on 12/12/2004 04:54:15
PM:

> There's way too much stuff under /var to do something like that.  If
> you've got logrotate running, most of it will take care of itself.
> You might want to purge "old" stuff out of /var/tmp/, but I would
> look very carefully at anything else, first.
>
> For your empty directory example, you're not checking dates, so they
> may have just been created when your scan runs.  While the contents
> of /tmp aren't guaranteed, I don't think that kind of behavior is
expected.
>
> Mark Post

<...snip...>

> I was planning to perform some housekeeping cleanup on a regular basis
for
> /tmp by including the following command in a cron:
>
> find /tmp -atime +30 -type f -print0 | xargs -0 rm
>
> I was going to do the same for the /var directory and got to thinking
that
> maybe I will get more than I bargain for. What is everyoneâs opinion
about
> removing all files that have not been accessed in 30 days for directory
> /var? Am I being over zealous?
>
> What about directories? Should I remove empty directories within /tmp and
> /var using a command like?:
>
> find /tmp âempty -type d -print0 | xargs -0 rmdir
>
> I welcome all comments. Thanks.
>
> Peter

<...snip...>

Re: Linux /tmp and /var housekeeping recommendations

2004-12-13 Thread Froberg, David C
Peter,

Are you sure you want to do /var?  I would think /var/tmp.  Other places like 
/var/log would, perhaps, be application 
specific?

Might want to consult the Filesystem Hierarchy Standard 
(http://www.pathname.com/fhs/2.2/) for /tmp and /var.

Dave

-Original Message-
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] Behalf Of
Peter E. Abresch Jr. - at Pepco
Sent: Sunday, December 12, 2004 4:40 PM
To: [EMAIL PROTECTED]
Subject: Linux /tmp and /var housekeeping recommendations



I was planning to perform some housekeeping cleanup on a regular basis for
/tmp by including the following command in a cron:

find /tmp -atime +30 -type f -print0 | xargs -0 rm

I was going to do the same for the /var directory and got to thinking that
maybe I will get more than I bargain for. What is everyoneâs opinion about
removing all files that have not been accessed in 30 days for directory
/var? Am I being over zealous?

What about directories? Should I remove empty directories within /tmp and
/var using a command like?:

find /tmp âempty -type d -print0 | xargs -0 rmdir

I welcome all comments. Thanks.

Peter


This Email message and any attachment may contain information that is
proprietary, legally privileged, confidential and/or subject to copyright
belonging to Pepco Holdings, Inc. or its affiliates ("PHI").  This Email is
intended solely for the use of the person(s) to which it is addressed.  If
you are not an intended recipient, or the employee or agent responsible for
delivery of this Email to the intended recipient(s), you are hereby
notified that any dissemination, distribution or copying of this Email is
strictly prohibited.  If you have received this message in error, please
immediately notify the sender and permanently delete this Email and any
copies.  PHI policies expressly prohibit employees from making defamatory
or offensive statements and infringing any copyright or any other legal
right by Email communication.  PHI will not accept any liability in respect
of such communications.


Re: Linux /tmp and /var housekeeping recommendations

2004-12-13 Thread Alan Cox
On Sul, 2004-12-12 at 21:40, Peter E. Abresch Jr. - at Pepco wrote:
> I was planning to perform some housekeeping cleanup on a regular basis for
> /tmp by including the following command in a cron:
> 
> find /tmp -atime +30 -type f -print0 | xargs -0 rm

There are better tools for this (tmpwatch for example) that know a bit
more about where to be careful.

> I was going to do the same for the /var directory and got to thinking that
> maybe I will get more than I bargain for. What is everyoneâs opinion about
> removing all files that have not been accessed in 30 days for directory
> /var? Am I being over zealous?

Probably. If someone leaves mail for a month should it vanish ? /var/tmp
is temporary but the rest of /var is merely writable not always
temporary.

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Linux /tmp and /var housekeeping recommendations

2004-12-13 Thread Rob van der Heij
On Sun, 12 Dec 2004 18:10:45 -0600, Tom Shilson <[EMAIL PROTECTED]> wrote:

> a month so it is not that big a deal. I was thinking of making /tmp a
> separate virtual file system like swap.

You don't mean to use VDISK for that, do you?

--
Rob van der Heij  rvdheij @ gmail.com

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Linux /tmp and /var housekeeping recommendations

2004-12-13 Thread Mark Post
Just in case anyone is interested, tmpwatch is included with RHEL3.  It appears 
the authors all work(ed) for Red Hat.  Source can be obtained at
http://ftp.redhat.com/pub/redhat/linux/enterprise/3/en/os/s390/SRPMS/tmpwatch-2.8.4-5.src.rpm

The md5 hash sums on the SRPMs for the various architectures are the same, so 
you'll only need one.


Mark Post

-Original Message-
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] Behalf Of
Alan Cox
Sent: Monday, December 13, 2004 6:36 AM
To: [EMAIL PROTECTED]
Subject: Re: Linux /tmp and /var housekeeping recommendations


-snip-
There are better tools for this (tmpwatch for example) that know a bit
more about where to be careful.

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Linux /tmp and /var housekeeping recommendations

2004-12-14 Thread Tom Shilson
Linux on 390 Port <[EMAIL PROTECTED]> wrote on 12/13/2004 04:29:19
PM:

> On Sun, 12 Dec 2004 18:10:45 -0600, Tom Shilson <[EMAIL PROTECTED]> wrote:
>
> > a month so it is not that big a deal. I was thinking of making /tmp a
> > separate virtual file system like swap.
>
> You don't mean to use VDISK for that, do you?

That is what I meant but I have been educated.  Real storage is too
valuable to spend on /tmp.

tom

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Linux /tmp and /var housekeeping recommendations

2004-12-12 Thread Mark Post
There's way too much stuff under /var to do something like that.  If you've got 
logrotate running, most of it will take care of itself.  You might want to 
purge "old" stuff out of /var/tmp/, but I would look very carefully at anything 
else, first.

For your empty directory example, you're not checking dates, so they may have 
just been created when your scan runs.  While the contents of /tmp aren't 
guaranteed, I don't think that kind of behavior is expected.


Mark Post

-Original Message-
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] Behalf Of
Peter E. Abresch Jr. - at Pepco
Sent: Sunday, December 12, 2004 4:40 PM
To: [EMAIL PROTECTED]
Subject: Linux /tmp and /var housekeeping recommendations



I was planning to perform some housekeeping cleanup on a regular basis for
/tmp by including the following command in a cron:

find /tmp -atime +30 -type f -print0 | xargs -0 rm

I was going to do the same for the /var directory and got to thinking that
maybe I will get more than I bargain for. What is everyoneâs opinion about
removing all files that have not been accessed in 30 days for directory
/var? Am I being over zealous?

What about directories? Should I remove empty directories within /tmp and
/var using a command like?:

find /tmp âempty -type d -print0 | xargs -0 rmdir

I welcome all comments. Thanks.

Peter


This Email message and any attachment may contain information that is
proprietary, legally privileged, confidential and/or subject to copyright
belonging to Pepco Holdings, Inc. or its affiliates ("PHI").  This Email is
intended solely for the use of the person(s) to which it is addressed.  If
you are not an intended recipient, or the employee or agent responsible for
delivery of this Email to the intended recipient(s), you are hereby
notified that any dissemination, distribution or copying of this Email is
strictly prohibited.  If you have received this message in error, please
immediately notify the sender and permanently delete this Email and any
copies.  PHI policies expressly prohibit employees from making defamatory
or offensive statements and infringing any copyright or any other legal
right by Email communication.  PHI will not accept any liability in respect
of such communications.

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390


Re: Linux /tmp and /var housekeeping recommendations

2004-12-14 Thread Rob van der Heij
On Tue, 14 Dec 2004 10:57:06 -0600, Tom Shilson <[EMAIL PROTECTED]> wrote:

> > You don't mean to use VDISK for that, do you?
>
> That is what I meant but I have been educated.  Real storage is too
> valuable to spend on /tmp.

It was easy for me to ask because it's so intuitive, and I hope I did
not sound as if that were the most stupid idea...  For most people
VDISK is cheap because it does not require talking to the person who
manages the disks.

As we know VDISK will eventually land on CP paging devices and the
disks for that are about the same cost as any other disk space (about
the same, because you want to keep paging utilization under 50% to
allow for efficient block paging). So it did seem like a good idea
because you share the unused space in your /tmp allocation among all
Linux servers.

One of the things that makes this work out less well in the end is the
allocation strategy of Linux on that file system. Instead of re-using
freed blocks, it will prefer to allocate fresh blocks, so over time
you will have touched every block in your /tmp file system. That is
not nice in a shared environment.

And as you say there is the issue of using real memory for the data.
But with MDC and Linux page cache doing that, you can not always avoid
that.

http://www.mail-archive.com/linux-390@vm.marist.edu/msg21730.html

YMMV: I am sure we can come up with examples where using VDISK for
/tmp is a huge benefit...
--
Rob van der Heij  rvdheij @ gmail.com

--
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390