Stop Finder/OSX From creating TemporaryItems and .apdisk on Network shares
Solution 1:
- Open Terminal.
- Execute this command:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
- Either restart the computer or log out and back in to the user account.
Reference: http://support.apple.com/kb/HT1629
Solution 2:
If you are running Windows file shares on Windows Server 2003 R2 and above, you can create file screens that prevent any user from creating any set of pre-specificied files.
I have effectively used this approach to eliminate all mac created files on our file shares.
Please see the MS Technet document, Screening Files, for more information.
Solution 3:
While this might not help everyone, if you are running samba on the file server, you can add the following in your smb.conf:
Veto files = /.TemporaryItems/._.TemporaryItems/.DS_Store/
The "Veto files" is a / separated string of filenames (wildcards also allowed) that is forbidden to be created. This resolved the issue for me.
I found this trick on the Arch Linux samba wiki
Solution 4:
BlueHarvest is probably the best and easiest way to maintain the network shares clean, at least that's what I went for after taking up most of your options myself.
After that is a cron job for deleting all of those files, using something like:
find "$@" \( -name ".DS_Store" -or -name ".TemporaryItems" -or -name ".Trashes" -or -name "._*" \) -exec rm -rf "{}" \; -prune