0

I use the following command in a scheduled Cron task to delete all files older than 30 days in a folder called Downloads:

find /home/orschiro/Downloads -path ./Archiveror -prune -path ./Fairphone -prune -o -type f -mtime +30 -exec rm {} \; && notify-send "Searching for old files..."

Thereby, I want to exclude:

  • the folder Archiveror with all its content which it does
  • and the folder Fairphone but keep its content checked if older than 30 days

How do can I tell the find command to not delete the folder Fairphone but its content if older than 30 days?

orschiro
  • 19,847
  • 19
  • 64
  • 95
  • this didnt helped you? http://stackoverflow.com/questions/4210042/exclude-directory-from-find-command – piyushj Jun 03 '16 at 11:29
  • I found this thread but couldn't find the information how to keep the contents of an excluded directory from not being excluded. – orschiro Jun 03 '16 at 11:36

0 Answers0