The easiest way would be to pipe the results of
find through
grep, then use it as an argument to
rm. You could use name patterns with
find, but you might not be able to prevent the deletion of the
contents of the directory easily.
Code:
rm -rfv $( /usr/bin/find /var/backup/sitebackup/ -mtime +5 -depth | egrep -v '(^|/)\.notdelete($|/)' )
ta0kira
edit:
I should have looked at the manpage:
Code:
/usr/bin/find /var/backup/sitebackup/ '!' -wholename '*/.notdelete/*' -a '!' -name .notdelete -mtime +5 -exec rm -rf "{}" ";"