LISTSERV mailing list manager LISTSERV 16.0

Help for LINUX-L Archives


LINUX-L Archives

LINUX-L Archives


LINUX-L@LISTS.UFL.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

LINUX-L Home

LINUX-L Home

LINUX-L  2007

LINUX-L 2007

Subject:

Re: Log backups

From:

Jon Lewis <[log in to unmask]>

Reply-To:

Platform Independent Linux List! <[log in to unmask]>

Date:

Tue, 14 Aug 2007 10:08:19 -0400

Content-Type:

TEXT/PLAIN

Parts/Attachments:

Parts/Attachments

TEXT/PLAIN (25 lines)

On Tue, 14 Aug 2007, ODEN,MARK THOMAS wrote:

> I have a daily cron job that tars and gzips hourly logs and places them in a
> new directory (/ftp/oldtraces) and deletes logs older than 24 hours. I was
> running the backup script w/o the daily delete command to test that the
> backups were going well and then enabled the delete command. Unfortunately
> the delete command deleted the entire /ftp/traces folder (including the
> folder itself) which caused no more logs to be uploaded. Can you help me fix
> this line so it doesn't delete the folder?
>
> find /ftp/traces -cmin +1440 -print | xargs rm -rf

Adding -type f will probably solve it. That way, find will only return
files...not directories.

find /ftp/traces -cmin +1440 -type f -print | xargs rm -rf

I also wonder if you really want -cmin or if -mmin would be more
appropriate?

----------------------------------------------------------------------
  Jon Lewis | I route
  Senior Network Engineer | therefore you are
  Atlantic Net |
_________ http://www.lewis.org/~jlewis/pgp for PGP public key_________

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997

ATOM RSS1 RSS2



LISTS.UFL.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager