Hi,
 how to remove all the sub-dirs under a directory based on modification time?
 for instance , under /data/user1 directory,  would like to delete all
these dirs if they have not been modified for
 more than 6 months, don't need to go into each of these sub-dirs,
only need to care about top
 sub-dir under /data/user1

 eg.


 # ls -ltr
total 36
-rwxr--r--   1 user1 rd 4662 Feb  3  2008 a.sh
drwxr-xr-x   5 user1 rd 4096 Feb  7  2008 perl
drwxr-xr-x   2 user1 rd 4096 Feb  7  2008 fonts
drwxr-xr-x   2 user1 rd 4096 Feb  7  2008 tmp
drwxr-xr-x  11 user1 rd 4096 Feb  7  2008 setup
drwxr-xr-x  14 user1 rd 4096 Feb  7  2008 something1
drwxr-xr-x   3 user1 rd 4096 Feb  7  2008 something1
drwxr-xr-x   2 user1 rd 4096 Feb  7  2008 something3

 I tested using:

control:
        actionsequence= ( tidy )

tidy:
        /data/user1
                                        pattern=*
                                        recurse=1
                                        rmdir=all
                                        age=200


ignore:
        /data/user1/per*

with "rmdir=all", only some of the dirs are deleted, also tried
"rmdir=sub", didn't work as intended either.

any help ? thanks.



-- 
Clay Ye
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to