Suppose the following call in a script:
find $dir/$CACHE_DIR_SUBPATH -type f -mtime +$RETENTION_DAYS -delete
Is there a neat way to print the file names that are going to be deleted or is the best option to call find twice like so:
find $dir/$CACHE_DIR_SUBPATH -type f -mtime +$RETENTION_DAYS
find $dir/$CACHE_DIR_SUBPATH -type f -mtime +$RETENTION_DAYS -delete