RE: Delete Files based on Date

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Oh if you only knew...

BUT, I have Linux now and I'm trying to become one with my inner geek.
Beside the obvious syntactical differences, there don't seem to be as many
cute little shortcuts. And I don't have any shoulders to stand on anymore.
Alas....

You all shall know me well before long!

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx]On Behalf Of Krautkramer, John
Sent: Wednesday, March 30, 2005 10:00 AM
To: General Red Hat Linux discussion list
Subject: RE: Delete Files based on Date


VMS... the OS that deserves the Energizer bunny as it's logo!

-----Original Message-----
From: Kelley.Coleman@xxxxxxxxxx [mailto:Kelley.Coleman@xxxxxxxxxx]
Sent: Wednesday, March 30, 2005 8:54 AM
To: redhat-list@xxxxxxxxxx
Subject: RE: Delete Files based on Date


Thank you, Ed and Stephen.  The find worked like a charm.


And, yes, VMS does kick butt.  ;-)

-----Original Message-----
From: redhat-list-bounces@xxxxxxxxxx
[mailto:redhat-list-bounces@xxxxxxxxxx]On Behalf Of Ed Wilts
Sent: Wednesday, March 30, 2005 9:43 AM
To: General Red Hat Linux discussion list
Subject: Re: Delete Files based on Date


On Wed, Mar 30, 2005 at 10:30:23AM -0600, Kelley.Coleman@xxxxxxxxxx wrote:
> I'm somewhat hampered by my OpenVMS experience with this problem.  

VMS forever!!! 

> I need a script that will remove all but the latest five files in a
> folder.  There is only one file per day and I want to keep five days
> worth.  

There are couple of options - find and tmpwatch.  Here are some examples:
find /var/log/samba -mtime +5 -exec rm {} \;
tmpwatch 120 /var/log/samba
tmpwatch --nodirs --mtime 120/usr/openv/netbackup/logs/

Both will do what you want. You can look at the various timestamps to
see if you want to base your deletion on created time, modified time, or
access time.

-- 
Ed Wilts, RHCE
Mounds View, MN, USA
mailto:ewilts@xxxxxxxxxx
Member #1, Red Hat Community Ambassador Program

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

-- 
redhat-list mailing list
unsubscribe mailto:redhat-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list

[Index of Archives]     [CentOS]     [Kernel Development]     [PAM]     [Fedora Users]     [Red Hat Development]     [Big List of Linux Books]     [Linux Admin]     [Gimp]     [Asterisk PBX]     [Yosemite News]     [Red Hat Crash Utility]


  Powered by Linux