smbdelete Files – How to Manage .smbdelete Files Accumulating on Server Share

macososx-server

I manage a very modest macOS server (Late 2014 Mac Mini, Mac OS 10.12.4, Server 5.3) that supports several sharepoints for about 20 clients – a mix of macOS and Windows. I typically have my work machine set to 'AppleShowAllFiles TRUE' so I notice that the shares are accumulating '.smbdelete…' files. These are hidden for most users, but they are getting a little annoying for me because the file listing of one share in particular is getting long. From web searches, it looks like this has to do with macOS' handling of SMB connections to shares.

So two questions:

  1. Can these be safely deleted?
  2. Can the accumulation of these be halted.

Best Answer

Find:

sudo find . -name '.smbdeleteAAA*' \( -type d -exec find {} \; -prune -o -print \)

Delete:

sudo find . -type f -name '.smbdeleteAAA*' -print0 | xargs -0 rm -f