I can use the following command to delete child directories in a particular directory older than x number of days
find /path/to/base/dir/* -type d -ctime +10 -exec rm -rf {} \;
but how would I delete child directories that were older than the date when another dirctory was created? I know I can get the date using
$ ls -l /var/www/cfs-web/current
lrwxrwxrwx 1 myuser mygroup 41 Feb 22 23:19 /path/to/main/dir
but I’m not sure how to combine this with the above.
ctime
is not creation time. It's inode change time, i.e. the time that attributes or metadata were changed for the file/directory