find

One thing you can't do with log rotate, is rotate directories. You can however, use a find command that executes a rm. One important thing is to use the -depth option so you don't get a bunch of file not found errors as find moves around the tree structure wrong.

sudo find /opt/IBM/tivoli/common/CTGIM/ffdc -depth -mtime +5 -exec rm -rf '{}' \;
Comments