TimeMachine: it’s alive, alive!

When I bought my iMac, I did a restore from my MacBook TimeMachine backup. When I continued working on my current project, I did notice a difference between the files that were on my MacBook and the files on my iMac. The files restored from the backup were not up-to-date and were from a few days ago.

I tried this snippet on MacOSXHints to compare Time Machine backups to the original drive, and it found differences between the original disk and the backup.

After having tried the usual suspect, i.e. check the disks, check the prefs, I tried to force a backup, i.e. touch the files, touch the parent folder, but the files would not backup.

I solved this by doing a clean TimeMachine backup: erase the TM volume and do a full backup.

I also wrote an application (not yet released) to check for differences between TM and the original disk. It can compare files in 2 different ways: the first is to just compare the dates, sizes or attributes between the backup and the original, the second way is to compare the content of the files. This second method being of course considerably slower than the first.

After a month, the first method did not find any differences between the backup and the original. So far, so good.

But using the second method, I found differences between files. The file date, size are identical, but the content is not. Using the diff command on the files confirmed this.

Differences were found in text files, Excel files, and NetNewsWire files (in the Application Support/NetNewsWire folder).

For Excel files, the differences are not visible when opening the files, but can be seen using TextWrangler “Hex Dump File” feature:

Original file:


00100860: 00 00 00 00 00 00 00 00 00 00 00 00 80 D2 AA 71 	...............q
00100870: 18 77 C8 01 FE FF FF FF 00 00 00 00 00 00 00 00 	.w..............
00100880: 57 00 6F 00 72 00 6B 00 62 00 6F 00 6F 00 6B 00 	W.o.r.k.b.o.o.k.

Backup file:


00100860: 00 00 00 00 00 00 00 00 00 00 00 00 00 E6 C3 6E 	...............n
00100870: A4 23 C8 01 FE FF FF FF 00 00 00 00 00 00 00 00 	.#..............
00100880: 57 00 6F 00 72 00 6B 00 62 00 6F 00 6F 00 6B 00 	W.o.r.k.b.o.o.k.

So there is a 6 bytes difference between the original and the backup and I have no idea why.

Comparing text files (the files are perl scripts, shell scripts) using the same method shows that the original files have Mac (CR) line endings and the backup files have Unix (LF) line endings. I double checked using hexdump to make sure TextWrangler did not auto-translate the line endings.

So is TimeMachine acting on his own?

2 thoughts on “TimeMachine: it’s alive, alive!

  1. This is a normal behavior of Excel: As soon as you open an excel file the file gets modified. The interesting part is if you close the file without saving it it will restore the original file date (before you opened it in excel). But the content of the file is still modified. I personally do not know what excel changes in the file but I guess excel will track there when the file was opened by the user. In fact the change is not essential and you can savely ignore it. We never had a problem or wrong data in the files because excel makes this little change in the file – we also synchronize (like TimeMachine) many many excel files…

  2. I havent checked if this still happens with MacOS X 10.5.6, but in my example above, there was no need to open the Excel file to have a difference between the backup and the orginal file.

    I will check and post the results.

Leave a Reply

Your email address will not be published. Required fields are marked *

*