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
Thank you for this! I was getting seriously frustrated having to manually clean up all this Mac crap from my shares since letting my girlfriend browse with her Mac and getting an Air myself. Just tested it doing “touch ._hello” on a share and getting “touch: ._hello: Permission denied” as a response. Muhahahahaha! :D
I can still create .Trashes and .TemporaryItems, though. Any particular reason you’re not doing,
veto files = /._*/.DS_Store/.Trashes/.TemporaryItems/
?
Thanks again! Love it :)
Hey Daniel, Nice to hear your enjoying yourself by annoying your gf ;-) (since those files mostly contain window position and in some cases app data, but are most of the time just crap anyway)
There’s no particular reason why I left those two out, my post just contained an example. Feel free to add entries to the veto files setting. :)
Here is some more info on the veto files setting in samba: http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#VETOFILES.
Thank you so much for this information
The samba related lead is exactly what I was looking for
Give yourself a raise !!!
Take care
Steve
Excellent – just what i was looking for!
Just had to leave a comment to say THANK YOU!! Those files have been bugging my network shares forever and thanks to this post I can 1) prevent the creation of them and 2) delete those already pestering my view. THANKS! :D
Woa, thanks you.
you might want to add all these to your veto files list
these are the veto file settings that Apple includes with its samba build on Mac OS X Server
/icon?/TheVolumeSettingsFolder/.DS_Store/.TemporaryItems/TheFindByContentFolder/.FBCindex/.FBCIndexCopy/.localized/Network Trash Folder/Temporary Items/Cleanup At Startup/.FBCLockFolder/.Trashes/._*/
This is great, just what I’ve been looking for. Have you noticed any performance impact from this? I imagine the server has do do more work now, checking the filename of every file.
Nah not really. Though I’m not working with major file servers right now that this was applied to. I’d say, give it a try ;)
our samba share just was saved
Thank you
Mac os garbage was bugging everyone, just becouse few people use MACs here (they are MACs fanbois)