Apple Crapintosh computer leaving trash all over my Unraid shares!


Kevin

Recommended Posts

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.

Link to comment
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.

Link to comment
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 "{}" \;

 

Link to comment

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.

Link to comment
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.

Link to comment

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.

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.