Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm looking for some way to configure OSX to prevent it creating .apdisk files and .TemporaryItems folders on network shares.

These are created any time OSX accesses a shared folder on the network.

In searching, some possible solutions I've found include:

  • Stop using the Application (Finder)
  • Mark the share(s) as read-only
  • Ignore them
  • Use 3rd party software (such as BlueHarvest) to remove the files.
  • Schedule a cron script to delete these files.

Unfortunately the first three options are not workable for me, and I'd rather not have to buy licences or schedule clean-ups on the file servers.

Is there a way to configure OSX not to create these in the first place?

(Finder is connecting via AFP to the network shares, for what it's worth)

Edit, approx 1 year later: Please note that I'm not looking for a cleanup solution.

BlueHarvest (if you have a mac to run it on), and scheduled cleanup scripts are fine - but less than ideal. I really need a solution which prevents OSX from creating these files in the first place.
At this point in time, it appears Apple don't provide such a configuration option which is disappointing.

share|improve this question
    
What kind of server(s) are you connecting to? OS X or something else? Also, why don't you want the files - I'm guessing non mac clients on those shares? –  snakechowder Feb 18 at 9:07
    
All kinds of servers - it doesn't matter. And yes, I don't want them because of non-mac clients, and general pollution of the shares. –  Will Hughes Feb 18 at 12:49
    
OK. I have the same problem but my solution is not within your parameters; I run dot_clean(1) from cron on the client(s) / suppress creation on the server. –  snakechowder Feb 18 at 16:12
add comment

3 Answers 3

If you are running Windows file shares on Windows Server 2003 R2 and above, you can create file screens that prevent any user from creating any set of pre-specificied files.

I have effectively used this approach to eliminate all mac created files on our file shares.

Please see the MS Technet document, Screening Files, for more information.

share|improve this answer
    
Oh, wow - that's an interesting solution. Had no idea File Screens existed. –  Will Hughes Mar 6 at 1:16
add comment
  1. Open Terminal.
  2. Execute this command: defaults write com.apple.desktopservices DSDontWriteNetworkStores true
  3. Either restart the computer or log out and back in to the user account.

Reference: http://support.apple.com/kb/HT1629

share|improve this answer
2  
Ah, unfortunately this only stops the .DS_Store files from being created, it doesn't stop .TemporaryItems folders and .APDisk files from being created. –  Will Hughes Apr 10 '13 at 1:17
    
#blameapple Nothing I can do. :( –  jnovack Feb 20 at 20:00
add comment

BlueHarvest is probably the best and easiest way to maintain the network shares clean, at least that's what I went for after taking up most of your options myself.

After that is a cron job for deleting all of those files, using something like:

find "$@" \( -name ".DS_Store" -or -name ".TemporaryItems" -or -name ".Trashes" -or -name "._*" \) -exec rm -rf "{}" \; -prune 
share|improve this answer
    
BlueHarvest and a cronjob were both already mentioned as non-preferred ways of dealing with this. –  Will Hughes Jan 17 at 5:35
    
Hi! I reckon you did mention that, but my answer served precisely the point of giving a recommendation from my previous (and current) experience. I still have BlueHarvest installed for achieving exactly what you need, having tried some other solutions similar to the ones you mentioned though none with the same success rate. I.e. it's still my best recommendation and in my pov worth the cost. –  acseven Feb 22 at 11:51
    
Thanks - I'm glad you find BlueHarvest valuable, and I'm sure others will find the script you've provided useful in scheduling cleanups. Neither meet the requirement of configuring OSX not to create them in the first place. BlueHarvest in particular, regardless of the price, is not useful for my situation - it would require the purchase of a mac, which isn't cost effective. Until Apple provide a configuration option to suppress this, the question will remain open. –  Will Hughes Feb 22 at 15:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.