Just add a -print
expression to the invocation of find
:
find <PATH> -type f -name "<filePattern>" -mtime +1 -delete -print > log
I'm not sure if this prints the name before or after the file is unlinked, but it should not matter. I suspect -delete -print
unlinks before it prints, while -print -delete
will print before it unlinks.