Re: Deleting files from O/S older than 6 hours

  • From: Carel-Jan Engel <careljan@xxxxxxxxxx>
  • To: nigel_cl_thomas@xxxxxxxxx
  • Date: Thu, 29 Nov 2007 12:10:02 +0100

On Thu, 2007-11-29 at 02:56 -0800, Nigel Thomas wrote:
> Another trick is to create or touch a marker file at the time you do
> the move, which you can use "next time" to tell you the O/S time to
> compare with:
>  
>  
>            find files newer than marker file (see earlier post)
>            move them / delete them / archive them
>            touch marker file now
>  
>  
> The only small issue is what happens to files added between 1 and 3
> (as the operations aren't exactly ACID)

That's why I do:

    touch temporary marker file
    find files newer than marker file
    do with them what you like
    move temporary marker file over marker_file

But this is getting much of a unix-shell thread now...
Jared won the contest, with his perl script.

Best regards,

Carel-Jan Engel

===
If you think education is expensive, try ignorance. (Derek Bok)
===



Other related posts: