I have directory names in the format of "yyyy-mm-dd_hh-mm-ss". Sometimes I want 
to delete all the non-empty directories that are from last week or earlier. 
Other times I want to delete all the directories that are over a week old.

Is there a script out there already that does this?

Assuming the answer is no, I started writing a script. Unfortunately, the 
following does not produce an error and does not work.

$ perl -MFile::Tasks -e '(File::Tasks->new)->remove_dir("2008-03-11_15-42-58/");

So how would you enumerate the directories, find the ones that are old 
(according to the above criteria) and delete them and their contents? What 
packages would you use?
Thanks,
Siegfried




Reply via email to