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

From: Chris F.A. Johnson (cfajohnson_at_gmail.com)
Date: 11/18/04


Date: 18 Nov 2004 18:08:51 GMT

On Thu, 18 Nov 2004 at 17:41 GMT, Damjan wrote:
> 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.

    There is no "create time". There is access (-atime), change of
    status (-ctime), and modifictation time (-mtime).

-- 
    Chris F.A. Johnson                  http://cfaj.freeshell.org/shell
    ===================================================================
    My code (if any) in this post is copyright 2004, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License


Relevant Pages

  • Re: CVS on remote server
    ... > Thanks, Matt. ... you can make a command line/shell/Perl/TCL script that does something, ... The CVS server uses pserver. ...
    (comp.os.linux.misc)
  • Re: Help with script to list non-html files in folder
    ... > although I have programmed in Delphi and VBA, and I took Matt Wright's ... > three folders but use the same script. ... are free to obtain the *actual* error message. ... Why do you refuse to let Perl ...
    (comp.infosystems.www.authoring.cgi)
  • Re: dropping all statistics
    ... but I'll take the script. ... Matt ... > Tibor Karaszi, SQL Server MVP ... >> get rid of all the statistics for the entire database. ...
    (microsoft.public.sqlserver.server)
  • Re: how to make a bash script run at boot-time?
    ... > Matt Bostock uttered the immortal words: ... >> I have a bash script which sets up my iptables. ... > Read /etc/defaults/iptables for more place/methods to load a ruleset. ... Checked by AVG anti-virus system. ...
    (alt.os.linux)
  • Re: SQL Timeout problem
    ... Matt ... > This list would change on repeated running of the script. ... > persistently blocked spids. ... >> Or Spotlight by Quest is a good tool for resource usage. ...
    (microsoft.public.sqlserver.server)