Help With Apple Script Please
I use rsync to do backups of files. When doing the backups, any changed/deleted files are put in an archive folder that rsync creates and names (year_month_day) as follows:
2022_06_23
2022_07_14
2022_10_31
I’ve added an automatic purge of the archive folder with this script: find /Volumes/Backup/Archives -type d -mtime +30
This does work for archive folders that have many dated folders within them, but I’ve found that if the archive folder is empty, the above script may delete the archive folder itself.
I’ve tried adding a forward slash at the end: find /Volumes/Backup/Archives/ -type d -mtime +30
And I’ve tried adding a back slash at the end: find /Volumes/Backup/Archives\ -type d -mtime +30
But neither of those two will prevent the actual “Archives” folder from being sometimes deleted.
So the question. How dose one write the script so that the “find” script only looks at folders inside the “Archives” folder, and never the “Archives” folder itself?
Mac mini, macOS 12.6