I have a network share I am hosting on a linux NAS in my house. There are a couple of annoyances with Apple lusers leaving .DS_Store files all over the network share, and messed up permissions on the files people upload to the share. Solution?
Learnt about cron and set up a couple of jobs to run.
Type ‘crontab -l’ to see what is currently set to run. ‘crontab -e’ brings up a vi like editor to edit the cron tasks. For specifics on how cron and crontab work check the manpages.
My share is in ‘/c/everybody’ and this is how I overcame these issues:
* * * * * chown -R nobody.nogroup /c/everybody 0 2 * * * find /c/everybody/ -name *.DS_Store -delete
The first line fixes up any messed up permissions. I am not 100% sure when this runs. Possibly immediately? The second line uses ‘find’ to search for those pesky DS_Store files and delete them all in one neat command.