51

I'd like to know to see which files are getting backed up by my time machine? I often see a large amount of data being transfered and I'm not sure sure what it is.

1

7 Answers 7

51

The command tmutil compare lets you compare file lists if you don't want to do it using ls or other commands that can show differences in files and folders like rsync and many graphical diff programs.

You can list backup paths and then copy them into the compare command. Example:

sudo tmutil listbackups
sudo tmutil compare "path1" "path2"

Many people adore BackupLoupe as well. It makes a powerful database of what files are included with each backup interval.

5
  • Thanks! i'll try it out when I'm by my TimeCapsule) I think this is exactly what I was looking for))
    – alexus
    Oct 15, 2012 at 17:17
  • Why not edit the question a bit to make it more clear what you were wanting. It'll likely get you some up votes if you care for it and put a real title on it rather than a fragment of a phrase.
    – bmike
    Oct 15, 2012 at 17:25
  • 4
    A zero cost alternative to BackupLoupe is TimeTracker. Does the job well enough for me. Oct 15, 2012 at 21:37
  • 4
    Honorable mention goes to timedog open source utility.
    – adib
    Feb 20, 2017 at 21:38
  • tmutil compare was very slow and showed me files that were not changed between backups - timedog was much better.
    – craig65535
    Nov 19, 2019 at 20:05
32

If you're interested in seeing what files are being read as the backup happens, you can use this command:

sudo opensnoop -n backupd | grep -v 'Time Machine Backups'

Note: the above worked in earlier versions of macOS. In High Sierra, something approximating this is:

sudo fs_usage -f filesys backupd

However there's a lot of noise from the backup volume itself that I haven't figured out how to get rid of.

4
  • 5
    I get a lot of lines like dtrace: error on enabled probe ID 5 (ID 161: syscall::open:return): invalid user access in action #11 at DIF offset 24 but nothing else. Jul 18, 2016 at 18:17
  • 1
    For anyone on High Sierra, add grep to the second command to get a decent list of only files: sudo fs_usage -f filesys backupd | grep -oi "HFS_update" Apr 5, 2018 at 17:52
  • On Sierra, sudo fs_usage -w -f filesys backupd | grep HFS_update works for me (and gets the full path for deep files/folders).
    – jhfrontz
    Apr 12, 2019 at 14:53
  • Here's a quick shell script I made in about 3 minutes that'll automatically print out each NEW file that is being read. So instead of getting a bunch of duplicate lines printed out over and over again, it'll only print the files once.
    – Max Coplan
    Sep 9, 2019 at 3:14
13

You can use timedog for that.

timedog is a Perl script that displays the set of files that were saved for any given backup created by Mac OS X Time Machine. By default it shows those files that were saved in the most recent backup. The listing includes the file sizes before and after, as well as a total file count and size. The script includes an option to summarize changes to a particular directory depth, producing a more concise display, helping to get an understanding of which areas of your system are taking up the most space in the backups. It can also sort by size, and/or omit files below a given size.

1
  • works well, even with AirportExpress attached storage.
    – YvesLeBorg
    Nov 22, 2014 at 16:33
9

If you want to watch which files are being transfered in realtime you can monitor the time machine daemon with

sudo fs_usage -f -R filesys backupd

If you see abnoramly large file transfer you might see disk images from virtual machines in the list

2
  • I'm guessing you meant sudo fs_usage -f filesys -R backupd instead... I'll check it out once I connect to my home network)
    – alexus
    Jul 15, 2016 at 13:13
  • That throws an Can't open RAW file: No such file or directory error, the man pages have an example like this fs_usage -w -f filesys Mail
    – Luddig
    Jul 15, 2016 at 13:56
6

I combined the above tmutil answer by BMIKE into this handy one-liner, hopefully it can help someone!

This will take the last 2 backups, and diff them for you. The sed is to put quotes around the backup names which will probably have spaces in them.

sudo tmutil listbackups | tail -2 | sed 's/.*/"&"/' | xargs  sudo tmutil compare
1
  • This does not work for me in Big Sur using APFS backups to sparesimage. Feb 3, 2022 at 23:03
3

I really like this commercial software BackupLoupe for analysing my backups.

enter image description here

3
  • warning: paid software
    – alexus
    Jun 30, 2020 at 19:55
  • 2
    @alexus Thanks. Included it in the answer. Not sure if commercial software warrants a "warning" ;) I like to pay for good software that simplifies my life.
    – n1000
    Jun 30, 2020 at 19:59
  • nothing wrong w/ commercial software) i say developer should be paid for his/her work) just a fair warning for everyone to know!
    – alexus
    Jul 1, 2020 at 15:57
-1

For me, on MacOS Ventura, the following code line works as a charme to show only files written to the backup disk:

sudo fs_usage -f -R filesys backupd | grep RdData
2
  • 2
    someone before you, already shared this very answer...
    – alexus
    Dec 8, 2022 at 15:09
  • Well, I added only the filter with the grep. Might be better as a comment, agree ... Dec 9, 2022 at 16:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .