Kevin Posted November 19, 2019 Share Posted November 19, 2019 I'm wondering if there's any way from the Unraid side to prevent the creation of .DS_Store and (sometimes hundreds) of ._FILENAME files in every.single.directory the Mac connects to? These files are not visible when browsing from the Mac itself using Finder, but they are visible and causing problems for non-Mac devices which also need to access these shares. Many thanks. Quote Link to comment
John_M Posted November 19, 2019 Share Posted November 19, 2019 You can configure macOS not to store those files on network attached storage with defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true 1 Quote Link to comment
wgstarks Posted November 19, 2019 Share Posted November 19, 2019 I believe the user scripts plugin also includes a script for cleaning out these files. 1 Quote Link to comment
Jimmy90 Posted November 20, 2019 Share Posted November 20, 2019 BlueHarvest is absolutely brilliant at that: http://www.zeroonetwenty.com/blueharvest/ Quote Link to comment
autumnwalker Posted November 20, 2019 Share Posted November 20, 2019 On 11/19/2019 at 9:54 AM, wgstarks said: I believe the user scripts plugin also includes a script for cleaning out these files. It removes .DS_Store, but does not remove the ._.DS_Store or other ._. metadata files I'm going to check the plugin thread for info on the other metadata files MacOS leaves. Quote Link to comment
wgstarks Posted November 20, 2019 Share Posted November 20, 2019 17 minutes ago, autumnwalker said: It removes .DS_Store, but does not remove the ._.DS_Store or other ._. metadata files I'm going to check the plugin thread for info on the other metadata files MacOS leaves. It’s pretty easily modified to include those files. I can post the script I use later if you want to see an example. Quote Link to comment
autumnwalker Posted November 20, 2019 Share Posted November 20, 2019 2 minutes ago, wgstarks said: It’s pretty easily modified to include those files. I can post the script I use later if you want to see an example. That would be great @wgstarks! Thank you. This is the most recent script showing in the support thread, but it does not appear to get any of the ._randomdocument.ext stuff. #!/bin/bash echo "This may take a while" echo "Searching for (and deleting) Apple Netatalk Files/Directories" find /mnt/user -maxdepth 9999 -noleaf \( -type f \( -name ".DS_Store" -o -name "._.DS_Store" \) -o -type d \( -name ".AppleDB" -o -name ".AppleDesktop" -o -name ".AppleDouble" -o -name ".TemporaryItems" \) \) -exec rm -r "{}" \; Quote Link to comment
wgstarks Posted November 20, 2019 Share Posted November 20, 2019 Here is the same basic script slightly modified- #!/bin/bash echo "Searching for (and deleting) .DS_Store Files in Media and flash" echo "This may take a awhile" find /mnt/user/Media -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \; find /boot -maxdepth 9999 -noleaf -type f -name ".DS_Store" -exec rm "{}" \; echo "=======================" echo "Searching for (and deleting) ._ files in Media and flash" find /mnt/user/Media -maxdepth 9999 -noleaf -type f -name "._*" -exec rm '{}' \; find /boot -maxdepth 9999 -noleaf -type f -name "._*" -exec rm '{}' \; echo "Cleanup Complete" This script is set to clean my “Media” share but you can change the path to /mnt/user to do a more general cleaning. The script will remove .DS_Store files and any file with a name beginning with “._”. I think that should get all the files you need but you can modify it to get other file names if needed. Be sure you don't have any files you want to keep that fall into these categories though. You won't be able to undo this. Quote Link to comment
autumnwalker Posted November 20, 2019 Share Posted November 20, 2019 Thanks @wgstarks. I think for my purposes I'll remove the /boot lines and let it run on /mnt/user. Quote Link to comment
juan11perez Posted November 20, 2019 Share Posted November 20, 2019 In this video spaceinvaderone addresses this issue and how to prevent it Quote Link to comment
SnickySnacks Posted November 20, 2019 Share Posted November 20, 2019 If you want Unraid itself to prevent these files from being created: 1. Stop array 2. Go to SMB Settings and add this to SMB Extra Configuration veto files = /._*/.DS_Store/.AppleDouble/.Trashes/.TemporaryItems/.Spotlight-V100/ delete veto files = yes 2 Quote Link to comment
Kevin Posted November 22, 2019 Author Share Posted November 22, 2019 On 11/20/2019 at 10:49 PM, SnickySnacks said: If you want Unraid itself to prevent these files from being created: 1. Stop array 2. Go to SMB Settings and add this to SMB Extra Configuration veto files = /._*/.DS_Store/.AppleDouble/.Trashes/.TemporaryItems/.Spotlight-V100/ delete veto files = yes Looks like we have a winner. Thanks for all the helpful suggestions, you guys rock. Quote Link to comment
SnickySnacks Posted November 22, 2019 Share Posted November 22, 2019 It's my preference to stop them on Unraid since I don't have to manage individual computers (or guests!). If you notice any new files that need to be added to the veto list, please let the community know. At this point my shares are all read-only as a ransomware preventative measure except for 1 share that I stage files to, so nothing can really make files in the array anymore anyways. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.