[ale] bash script

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Sep 11 14:33:44 EDT 2007


On Tue 2007-09-11 14:24:01 -0400, Marvin, International Martian of Mystery wrote:

> I like this answer the best- because it whittles the process down to
> one command.  Gotta like that.

glad you like it.

> What I'm trying to delete are subdirs full of files, I'm afraid.
> Zoneminder (the program producing the data I'm deleting) stores all it's
> "events" in numbered sub-directories under a numbered directory
> corresponding to the video channel producing the "events".  I want to
> take out everything under the specified video channel's directory that's
> 5 days old or older.
>
> If I remove the "-type f" flag from the above, will it kill the
> directories under the ones indicated by the braces?

yup.  it might also kill the directories enumerated by the brace
expansion too, though, if they haven't been touched in the last 5
days.  You might want to add something like "-mindepth 1" to make sure
that the original dirs stick around (if you care).

Do write back when you've tested and figured out your final
invocation, so we can all learn from your work!

Regards,

   --dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 826 bytes
Desc: not available




More information about the Ale mailing list