Comparing Time Machine Backups

tyr2

macrumors 6502a
Original poster
May 6, 2006
801
83
Leeds, UK
I was wondering what was using up space on my TM drive so I've put a short perl script together that compares two time machine backups so you can see what's changed between one and the next.

You need to run it from the Terminal. Here's an example session.

Code:
$ perl timecomp.pl 
Select a Time Machine image

--------------------

1 - /Volumes/TimeMachine/Backups.backupdb/njord

q - Exit
> 1
Select a version to compare
-----------

1 - 2007-10-28-005014
2 - 2007-10-28-015622
3 - 2007-10-30-211043
4 - 2007-11-02-201735
5 - 2007-11-03-000311
6 - 2007-11-04-135929
7 - 2007-11-04-141649
8 - 2007-11-04-151542
9 - 2007-11-04-161654
10 - 2007-11-04-174111
11 - 2007-11-04-183518
12 - 2007-11-04-190638
> 11
Select a version to compare 2007-11-04-183518 to
-----------

1 - 2007-10-28-005014
2 - 2007-10-28-015622
3 - 2007-10-30-211043
4 - 2007-11-02-201735
5 - 2007-11-03-000311
6 - 2007-11-04-135929
7 - 2007-11-04-141649
8 - 2007-11-04-151542
9 - 2007-11-04-161654
10 - 2007-11-04-174111
11 - 2007-11-04-183518
12 - 2007-11-04-190638
> 12

Comparing 2007-11-04-183518 to 2007-11-04-190638
c - /.exclusions.plist
c - /.Backup.log
c - /.com.apple.TMCheckpoint
c - /MacMirror/.com.apple.timemachine.supported
c - /MacMirror/Users/gordonj/.bash_history
c - /MacMirror/Users/gordonj/.viminfo
d - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 1/OSXplanet.Desktop.6139558.png
n - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 1/OSXplanet.Desktop.3707638.png
d - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 2/OSXplanet.Desktop.6139558.png
n - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 2/OSXplanet.Desktop.3707638.png
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/presets/Earth - SC1.osxplanet/CityData
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/presets/Preset 1.osxplanet/CityData
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/config/xplanet.2.config
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/config/xplanet.1.config
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/.database.lockN
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/AddressBook-v22.abcddb
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/Metadata/.info
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/Metadata/ABInfo.abcdi
---snip----
The first column indicates the type of change

n - New in the second selected version
d - Deleted in the second selected version
c - Changed between the first and second selected versions.

It's not tested much but should work ok, it doesn't make any changes to your TM drive. If you get errors about 'permission denied' then you need to run it as root as your user can't see into a directory.

You can download it here if you want to give it a go.

Any feedback or suggestions for improvements welcome.

Edit: Just a note to say if an entire directory has been added or removed you'll only see the entry for the directory not the individual files inside it. eg:
n - /PlanetExpress/iTunes/iTunes Music/Compilations/A City Centre Offices Sampler/
 

gr8tfly

macrumors 603
Oct 29, 2006
5,299
50
~119W 34N
I was wondering what was using up space on my TM drive so I've put a short perl script together that compares two time machine backups so you can see what's changed between one and the next.

You need to run it from the Terminal. Here's an example session.

Code:
$ perl timecomp.pl 
Select a Time Machine image

--------------------

1 - /Volumes/TimeMachine/Backups.backupdb/njord

q - Exit
> 1
Select a version to compare
-----------

1 - 2007-10-28-005014
2 - 2007-10-28-015622
3 - 2007-10-30-211043
4 - 2007-11-02-201735
5 - 2007-11-03-000311
6 - 2007-11-04-135929
7 - 2007-11-04-141649
8 - 2007-11-04-151542
9 - 2007-11-04-161654
10 - 2007-11-04-174111
11 - 2007-11-04-183518
12 - 2007-11-04-190638
> 11
Select a version to compare 2007-11-04-183518 to
-----------

1 - 2007-10-28-005014
2 - 2007-10-28-015622
3 - 2007-10-30-211043
4 - 2007-11-02-201735
5 - 2007-11-03-000311
6 - 2007-11-04-135929
7 - 2007-11-04-141649
8 - 2007-11-04-151542
9 - 2007-11-04-161654
10 - 2007-11-04-174111
11 - 2007-11-04-183518
12 - 2007-11-04-190638
> 12

Comparing 2007-11-04-183518 to 2007-11-04-190638
c - /.exclusions.plist
c - /.Backup.log
c - /.com.apple.TMCheckpoint
c - /MacMirror/.com.apple.timemachine.supported
c - /MacMirror/Users/gordonj/.bash_history
c - /MacMirror/Users/gordonj/.viminfo
d - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 1/OSXplanet.Desktop.6139558.png
n - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 1/OSXplanet.Desktop.3707638.png
d - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 2/OSXplanet.Desktop.6139558.png
n - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/desktop/screen 2/OSXplanet.Desktop.3707638.png
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/presets/Earth - SC1.osxplanet/CityData
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/presets/Preset 1.osxplanet/CityData
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/config/xplanet.2.config
c - /MacMirror/Users/gordonj/Library/Application Support/OSXplanet/config/xplanet.1.config
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/.database.lockN
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/AddressBook-v22.abcddb
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/Metadata/.info
c - /MacMirror/Users/gordonj/Library/Application Support/AddressBook/Metadata/ABInfo.abcdi
---snip----
The first column indicates the type of change

n - New in the second selected version
d - Deleted in the second selected version
c - Changed between the first and second selected versions.

It's not tested much but should work ok, it doesn't make any changes to your TM drive. If you get errors about 'permission denied' then you need to run it as root as your user can't see into a directory.

You can download it here if you want to give it a go.

Any feedback or suggestions for improvements welcome.
Didn't think about OSXPlanet until now. It'll be added to the excluded items. Thanks.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.