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
Archiverorwith all its content which it does - and the folder
Fairphonebut 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?