Re: a script to clean up all files in the last M minutes

From: Damjan (gdamjan_at_gmail.com)
Date: 11/18/04


Date: Thu, 18 Nov 2004 18:41:48 +0100

Matt wrote:

> I need to write a script that takes a parameter minute M to clean up
> all files in a folder that are older than M compare with current system
> time.

define older! access time or create time?

anyway 'find' will do it (options -amin, -cmin, -atime, -ctime, etc...).

find -cmin +10 -exec rm {} \; will delete files created 10 or more minute
before now.

-- 
damjan


Relevant Pages

  • Comparing multi paradox files
    ... easiest way for me to compare the database files. ... form the master list. ... Here is how I get the paradox files, each location has a master folder ...
    (microsoft.public.access.externaldata)
  • Re: Lost & Found files mystery.
    ... The older CD burning software has a limit on file length. ... I then used windiff from the 98 cd to compare the cd and d ... The folder was there but no files. ... However windows 98 could not read them from the cd due to the ...
    (microsoft.public.windowsxp.general)
  • Re: Boris Johnsons bike stolen
    ... Does anyone here know if Matt really believes this shit, ... just trolling still? ... Compare the treatment of the "prolific bike thief", ... Which implied, derived from /one/ example, that bike thieves are treated more leniently than car thieves. ...
    (uk.rec.cycling)
  • Re: Partition and Dual Boot MkII (longish)
    ... >> So you can compare yours with that layout. ... The 98 Product Recovery CD has a root dir called WIN98_SE and four sub ... I do not have the CDSAMPLE folder. ...
    (uk.people.silversurfers)
  • Re: Search non-empty rows, compare text
    ... You can't have two files with the same name in a folder. ... information in a few rows (filename, filetype, filepath, date modified, ... at the moment it assumes a new spreadsheet as it starts ... compare two columns at on each row. ...
    (microsoft.public.excel.programming)