Don’t you hate it when your file server is filled with .DS_Store files and .TemporaryItems directories? .DS_Store files are hidden files created by Mac OSX in each directory you access with Finder and stores custom attributes of a folder like icon position and background images. Since they’re ‘custom’ and besides that they’re annoying, you don’t want single suctom settings to be applied to a network share. So let’s disable those.
Open up /etc/samba/smb.conf and add the following lines to each share:
veto files = /._*/.DS_Store/ delete veto files = yes
Now restart samba.
Time to cleanup existing Mac OSX files! You can do that with this command:
find \( -name ".DS_Store" -or -name ".Trashes" -or -name "._*" -or -name ".TemporaryItems" \) -delete
You can also add the command above to a cron, to scan (f.e.) on a weekly base for these files.
Next to that, on your mac client, use this command to prevent any future creation of .DS_Store files on network shares:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true