Delete files older than 7 days?

General support questions including new installations
pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: Delete files older than 7 days?

Post by pschaff » 2010/01/26 22:26:46

Good point:[code]
find /temp1 -mtime +7 -type f -ls
OR
find /temp1 -mtime +7 -type f -exec ls -l {} \;[/code]

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: Delete files older than 7 days?

Post by michaelnel » 2010/01/26 22:28:46

Yep. You get one of those that goes wrong and you can wreak a lot of havoc in a short amount of time. ;-)

Don't ask me how I know this.

gertrudis
Posts: 6
Joined: 2010/01/26 02:13:07
Contact:

Re: Delete files older than 7 days?

Post by gertrudis » 2010/01/26 23:42:47

thanks to all for reply i'll start testing.

User avatar
toracat
Site Admin
Posts: 7518
Joined: 2006/09/03 16:37:24
Location: California, US
Contact:

Re: Delete files older than 7 days?

Post by toracat » 2010/01/27 00:13:07

[quote]
michaelnel wrote:
Yep. You get one of those that goes wrong and you can wreak a lot of havoc in a short amount of time. ;-)

Don't ask me how I know this.[/quote]
Do tell. :-D

michaelnel
Posts: 1478
Joined: 2006/05/29 16:50:11
Location: San Francisco, CA

Re: Delete files older than 7 days?

Post by michaelnel » 2010/01/27 00:22:46

[quote]
toracat wrote:
Do tell. :-D[/quote]

Gimme root access on one of your systems and I will demonstrate.

Post Reply