I am writing ant script to clean archive folder
Here's how I need to clean it: I need to delete old folders than a certain number of days, and it contains more than 3 files. For example, if a folder is 300 days but has only 3 files, it will not be deleted.
I know that I can make ssh in the archive and do find -mtime +365 -exec rm -rf {} ;\ to delete files older than 1 year, but I do not know how to account for at least 3 files
I also know that find -type f | wc -l find -type f | wc -l will list the number of files, but this does not help in terms of scripts
Any ideas?
source share