avi530

Q: .MobileBackups.trash DELETION

Does anyone know the exact terminal command to delete .MobileBackups.trash from a macbook on mavericks. I have disabled local backups via terminal but the .MobileBackups.trash folder just won't go away. Using Daisy Disk, I can see that the folder is 20 GB. I have even filled my computer up with files so that there is only 2GB left on my SSD and the .MobileBackups.trash folder will still not delete automatically like it should. Would really appreciate some help!

MacBook Pro (Retina, Mid 2012), OS X Mavericks (10.9.1)

Posted on Jan 5, 2014 12:37 AM

Close

Q: .MobileBackups.trash DELETION

  • All replies
  • Helpful answers

Previous Page 2
  • by DMK73,

    DMK73 DMK73 Feb 20, 2016 11:19 AM in response to korsbakken
    Level 1 (4 points)
    Photos for Mac
    Feb 20, 2016 11:19 AM in response to korsbakken

    I also found that the locked CrashPlan.app blocks Time Machine from pruning expired backups on external or network drives. I had to manually unlock the app folder in all snapshots for Time Machine 'post-backup thinning' to function as designed. Building on korsbakken's solution, here are all the steps that I have taken to resolve the issue with CrashPlan.


    # Unlock all local expired backup copies of CrashPlan

    sudo find /.MobileBackups.trash -flags +schg -exec chflags noschg {} \;

     

    # Unlock all backup copies of CrashPlan

    # Need to run from Time Machine machine directory (e.g. /Volumes/MyExternalHD/Backups.backupdb/MyMac/)

    find . -maxdepth 1 -type d -exec sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass chflags noschg "{}"/Macintosh\ HD/Applications/CrashPlan.app \;

     

    # Unlock CrashPlan application

    sudo chflags noschg /Applications/CrashPlan.app

    # Or exclude CrashPlan from backups

    sudo tmutil addexclusion /Applications/CrashPlan.app

     

    Code42 (the developers of CrashPlan) told me that "CrashPlan is required to be run from the Application folder, so we lock it to prevent it from being moved".

  • by mfrazzz,

    mfrazzz mfrazzz Mar 11, 2016 9:41 AM in response to DMK73
    Level 1 (4 points)
    Mar 11, 2016 9:41 AM in response to DMK73

    I've taken DMK73's script a little further.  You will need to edit at the top tmdir to be the directory to your Time Machine backup.  When run, this will make sure that directory exists first then will do the same modifications.  I've added the -v flag to the chflags command so it shows what files are being modified.  All output is written to a file in /tmp and then at the end it displays the output without any of the "no such file or directory" messages.

     

     

    #!/bin/bash

     

    # This script fixes an issue with the /.MobileBackups.trash folder that is created by CrashPlan

    # Most of the script comes from this thread: https://discussions.apple.com/thread/5750388?start=15&tstart=0

     

    tm_dir="/Volumes/Time Machine/Backups.backupdb/mikes-macbookpro"

    tmpout="/tmp/fix_MobileBackupsTrash.tmp"

     

    if [ ! -d "$tm_dir" ]

    then

       echo "Time Machine directory is not found!  Fix the script"

       exit 1

    fi

     

    cd "$tm_dir"

     

    echo > $tmpout 2>&1

    echo "----------------------------------------" >> $tmpout 2>&1

    echo "Starting on $(date)" >> $tmpout 2>&1

    echo "----------------------------------------" >> $tmpout 2>&1

    echo >> $tmpout 2>&1

     

    # Unlock all local expired backup copies of CrashPlan

     

    [ -f /.MobileBackups.trash ] && sudo find /.MobileBackups.trash -flags +schg -exec chflags -fv noschg {} \; >> $tmpout 2>&1

     

    # Unlock all backup copies of CrashPlan

    # Need to run from Time Machine machine directory (e.g. /Volumes/MyExternalHD/Backups.backupdb/MyMac/)

    find . -maxdepth 1 -type d -exec sudo /System/Library/Extensions/TMSafetyNet.kext/Contents/Helpers/bypass chflags -fv noschg "{}"/Macintosh\ HD/Applications/CrashPlan.app \; >> $tmpout 2>&1

     

    # Unlock CrashPlan application

    sudo chflags -fv noschg /Applications/CrashPlan.app >> $tmpout 2>&1

    # Or exclude CrashPlan from backups

    #sudo tmutil addexclusion /Applications/CrashPlan.app >> $tmpout 2>&1

     

    echo >> $tmpout 2>&1

    echo "-----------------------------------------" >> $tmpout 2>&1

    echo "Completed on $(date)" >> $tmpout 2>&1

    echo "-----------------------------------------" >> $tmpout 2>&1

    echo >> $tmpout 2>&1

     

    grep -v "CrashPlan.app: No such file or directory" $tmpout

  • by Karl Kaufmann,

    Karl Kaufmann Karl Kaufmann May 6, 2016 9:18 AM in response to nbar
    Level 1 (93 points)
    May 6, 2016 9:18 AM in response to nbar

    Thanks for the info.

     

    I needed to run this for a somewhat related problem--running a Time Machine backup that then would be used to restore to a new SSD with 1/2 the capacity of the original. When running the command though, I was hit with similar errors, due to permissions issues (I assume the system still had locked some of the files). So, I stopped the process, and went through a few restarts.

     

    After this, checking both in Finder and Disk Utility indicated that the trashed Mobile Backups had indeed been deleted.

     

    Not sure on this (maybe someone can enlighten), but I have a feeling, the trashed Mobile Backups are locked this way as a protective measure, in anticipation of drastic user errors, to give a last-ditch option of recovery.

     

    I know it can be frustrating (I had to do quite a bit of searching to find this info), but often it looks like multiple restarts are the most trouble-free way to deal with this.

  • by DMK73,

    DMK73 DMK73 Sep 22, 2016 1:40 PM in response to DMK73
    Level 1 (4 points)
    Photos for Mac
    Sep 22, 2016 1:40 PM in response to DMK73

    For CrashPlan For Home Version 4.7 -

    OS X devices now prevent Time Machine from backing up the CrashPlan app bundle, which was causing high CPU usage for some users (source).

     

    This can be verified by typing the following command in Terminal -


         mdls /Applications/CrashPlan.app | grep backupd

Previous Page 2