Any way to prevent Time Machine from trying to back up “new” drives?

Discussion in 'Mac Apps and Mac App Store' started by ytk, Feb 25, 2014.

  1. ytk macrumors regular

    Joined:
    Jul 8, 2010
    #1
    I regularly connect various drives to my system temporarily, just to be able to shuffle files around onto other volumes. The problem is that when I have these drives connected, Time Machine will stupidly try to back them up. This is a problem when I'm connecting 8TB drives and my Time Machine drive is only 2TB.

    I don't want or need these drives backed up. In fact, I only really want to back up two drives and nothing else. But no matter how many times I drag the drives into the excluded drives list in Time Machine preferences, they eventually show up again after being disconnected and reconnected a few times.

    Does anybody know if there's any way to tell Time Machine to stop being so eager to back everything up, and just stick to backing up the two volumes I tell it to?
     
  2. Bruno09 macrumors 68020

    Joined:
    Aug 24, 2013
    Location:
    Far from here
    #2
    What is your OS ?

    From Lion (I think, but not sure), Time Machine does NOT backup external hard drives : they are listed in the "exclusions" list (System Preferences/Time Machine/Options).

    If you wanted to backup an external volume, you would have to remove it from the exclusions list.
     
  3. ytk thread starter macrumors regular

    Joined:
    Jul 8, 2010
    #3
    I'm on Lion, but it's constantly trying to back external drives up anyway. The problem may be that it doesn't see them as “external” drives since they're connected over eSATA or USB 3 (Mac Pro with PCIe cards installed for both). The eject arrow doesn't show up next to drives that are connected via USB 3 or eSATA, but it does for Firewire and USB 2 drives. The consequence is that when these drives are connected, Time Machine deletes all my old backups to save space, then concludes it still doesn't have enough space and the backup fails anyway.

    I don't understand why it has to be so aggressive about what it decides to back up. It would be nice if I could tell it to JUST back up these two drives, and never anything else.
     
  4. Bruno09 macrumors 68020

    Joined:
    Aug 24, 2013
    Location:
    Far from here
    #4
    Can't you go to System Preferences/Time Machine/Options and add the volumes you don't want to backup to the exclusions list ?
     
  5. ytk thread starter macrumors regular

    Joined:
    Jul 8, 2010
    #5
    That's what I'm saying—I've done that, numerous times. The problem is that sometimes these drives remove themselves from that list. Also, whenever I connect a new drive that the system hasn't seen before, I have the same problem. Since I do this pretty regularly, it's a real hassle to ensure that each drive I connect is on the excluded list, and if I forget to do so before the next Time Machine backup, it deletes all my old backups.

    I don't want to screw around with excluding drives. I want it to only back up the drives I tell it to, and never anything else. This seems like it should be a really simple thing to do, but Apple apparently makes it difficult or impossible for reasons that are utterly beyond me.
     
  6. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #6
    I think you just answered your own question. Like others mentioned, external drives are excluded from a TM backup by default, but your system is not seeing drives attached via these PCIe cards as external so they get included.

    I wonder if the PCIe card vender might be able to help with a firmware update?
     
  7. ytk thread starter macrumors regular

    Joined:
    Jul 8, 2010
    #7
    So the answer is basically, no, you can't just get Time Machine to back up only the drives you tell it. Guess that would be too simple. Thanks, Apple. :mad:
     
  8. flynz4 macrumors 68040

    Joined:
    Aug 9, 2009
    Location:
    Portland, OR
    #8
    I really am confused at your problem.

    When you first establish Time Machine on your system... it defaults to your internal drive. If you want to exclude part of it, you do it once.

    Then, in the future, as you add and remove external drives... they are automatically excluded. You can add/remove external drives at will without them affecting what is being backed up.

    If you decide to add an external that you want to be in the backup set (ex: I have a Pegasus R4 that is always connected)... you go in to Time Machine preferences just once, and manually unselect it from the exclusion list.

    It sounds like you have some type of aberrant behavior. Time Machine should be doing exactly what you want.

    /Jim
     
  9. ChrisA macrumors G4

    Joined:
    Jan 5, 2006
    Location:
    Redondo Beach, California
    #9
    The default has to be one or the other. I think Apple did the right think, it is the best way for 99.9% of their users, you are the odd case.
     
  10. thaboz macrumors newbie

    Joined:
    Sep 6, 2008
    #10
    Disable Time Machine for new disks

    You can disable new disks for backups in TimeMachine by entering the following command in Terminal (Macintosh HD/Applications/Utilities)

    defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool YES
     
  11. Bear macrumors G3

    Joined:
    Jul 23, 2002
    Location:
    Sol III - Terra
    #11
    This only prevents Time Machine from asking if you want to use the drive for Backups. It won't prevent Time Machine from backing up a just attached disk..
     
  12. Brian33 macrumors 6502a

    Joined:
    Apr 30, 2008
    Location:
    USA (Virginia)
    #12
    It seems Time Machine treats external and internal drive volumes differently, and the eSATA and USB 3 drives are seen as internal. I can understand why that's a problem for the OPer.

    There might be a work-around that would suffice in certain cases: if you don't have too many files or folders at the root level of the volumes to be excluded, and you don't often create more there.

    There is another way to exclude items from TM backups. The terminal command "tmutil" has an "addexclusion" verb with a "-p" option. The man page explains that "there are two kinds of user-configurable exclusions in Time Machine." The first kind (without the -p option) "is a location-independent ("sticky") exclusion that follows a file or directory." The second kind (using the -p option) is "a fixed-path exclusion."

    It appears that the exclusion list we see in System Preferences uses the "second kind" and is sometimes automatically inserted or removed based on internal/external drive status.

    The "first kind" is interesting. My very limited testing indicates that it is implemented by setting a filesystem attribute on the desired file or folder. TM presumably takes note of the attribute and decides not to back up the item.

    What I'm suggesting is that you could set this attribute (using the tmutil command) for all of the root-level files and folders on your "problem" external drives. Once you've set it, they won't get backed up (I predict). (However, if you add new files or folders to the root-level of the drive, that new item will get backed up.)

    Here are some interesting commands for the curious. These should be pretty safe, but I've only done limited testing and can make no guarantees!

    Output a list of files that are excluded from TM backups (I believe this uses Spotlight metadata, so will only display files that have been indexed by Spotlight):
    mdfind "com_apple_backup_excludeItem = com.apple.backupd"

    Display the extended attributes for a file to see if it's excluded (should work on any file/folder):
    xattr Desktop/foo/
    (Look for something like "com.apple.metadata:com_apple_backup_excludeItem", indicating the file/folder will be excluded.)

    Add a Time Machine exclusion that "sticks with" a file or folder in the form of an extended attribute:
    tmutil addexclusion Desktop/foo/
    (Presumably you could do something like "tmutil addexclusion /Volumes/MyExternal/*", but I haven't tried it.)

    Read about the tmutil addexclusion command:
    man tmutil
     
  13. ytk thread starter macrumors regular

    Joined:
    Jul 8, 2010
    #13
    Ah ha, thank you!! That was just the info I needed.

    Your solution of adding files in the root folder of the volumes to the exclusion list wouldn't work for me, because unfortunately the files are always added to the root folder of the volume. Also, I'd have to do it for each drive I connect, and I sometimes get random drives that I haven't connected before. It was a really good idea though, and it got me thinking.

    I had a look at using tmutil to control exclusions, and put together a Ruby script that adds an exclusion to every locally mounted volume except for the ones I want to back up (you can add an exclusion to the volume itself, not just the files on the volume). I just built that into a launchd plist and loaded it as root, set to launch on system start and whenever any volume is mounted.

    So far it appears to work exactly the way I wanted. Even if I delete all of the drives from the Time Machine exclusion list in System Preferences, as soon as I mount any drive they all show right back up again! Nice!
     
  14. Brian33 macrumors 6502a

    Joined:
    Apr 30, 2008
    Location:
    USA (Virginia)
    #14
    Yay -- that's cool! I'm glad I could help and I like your solution. Also, I didn't know one could specify StartOnMount for launchd tasks -- so that's a good new tidbit of knowledge for me!

    It seems to me that Apple should or will have to change the behavior of Time Machine regarding "internal" drives, especially because I've read that Thunderbolt-attached drives appear as internal drives, too. More people are bound to run into the same problem you had, I think!
     

Share This Page