[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [cobalt-users] deleteing old files
- Subject: RE: [cobalt-users] deleteing old files
- From: "Thomas Hodkin" <tom@xxxxxxxx>
- Date: Tue Jan 15 08:02:01 2002
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
do you do this maualy or do you have some sort of script which runs on its
own
tom hodkin
-----Original Message-----
From: cobalt-users-admin@xxxxxxxxxxxxxxx
[mailto:cobalt-users-admin@xxxxxxxxxxxxxxx]On Behalf Of Parker Morse
Sent: 15 January 2002 14:28
To: cobalt-users@xxxxxxxxxxxxxxx
Subject: Re: [cobalt-users] deleteing old files
> From: "Chris Demain" <cdemain@xxxxxxxxxxx>
>> hi does anyone if there is a way to delete file out of a specified
>> directory if they are older then a required date
> man find
>
> here are some interesting options (tip of the iceberg):
> -mmin n
> File's data was last modified n minutes ago.
>
> -mtime n
> File's data was last modified n*24 hours ago.
>
> -name pattern
> Base of file name (the path with the leading direc
> tories removed) matches shell pattern pattern. The
> metacharacters (`*', `?', and `[]') do not match a
> `.' at the start of the base name. To ignore a
> directory and the files under it, use -prune; see
> an example in the description of -path.
>
> -newer file
> File was modified more recently than file. -newer
> is affected by -follow only if -follow comes before
> -newer on the command line.
>
>
> find . -type f --some_options | xargs rm
Comparing various ways of skinning cats: I've used the following:
rm -rdf $(find /path/to/ftp/ -ctime +7)
to clear files older than a week in my incoming FTP directory. The flaw here
is that it refuses to delete directories, even though it supposedly should.
Perhaps I should try your way?
pjm
_______________________________________________
cobalt-users mailing list
cobalt-users@xxxxxxxxxxxxxxx
To Subscribe or Unsubscribe, please go to:
http://list.cobalt.com/mailman/listinfo/cobalt-users