For years, I used Time Machine, trusting that it would permit me to restore my files if something went very wrong.
On 24th November 2014, I made exactly the kind of mistake that backups are for. I deleted an entire directory, which itself contained 59 subdirectories and 2430 files. I did not send it to the Trash bin; I deleted it, using unix, as follows. In the Terminal Application, i.e., in the unix bash shell, I cd-ed to the Jovin directory and typed:
rm -rf *I had intended to do that in a small junk directory to clear it out. An instant later, I realized that I had done it in the precious Jovin directory. Thus, I had deleted all files and subdirectories under that directory.
The directory contained everything I had done for this project since April 2011, all correspondence, all code, all results, in an easy-to-access, documented order.
What happened?
To wrap up the current phase of this project, I had worked from 16:30 on a Sunday night until 07:30 on Monday morning, had collapsed finally for a four-hour nap, and it was in my fuzzy state of mind after waking back up that I made this mistake.
No problem, right? This is exactly the kind of situation that backups are for. So I entered Time Machine, found the Jovin directory from an hour before my big mistake, and instructed Time Machine to restore the entire thing to a new location. A moment later I got the following dialog box:
The file in question was one of many small backups I had made, using the unix tools tar, gzip, and chmod.
Only a small fraction (15%) of the files had been restored before Time Machine chose to stop doing its job:
~/Documents/tmp/RESTORE> ls ./ ../ Jovin/ ~/Documents/tmp/RESTORE> find . -type f | wc 377 377 22204 ~/Documents/tmp/RESTORE>
Fortunately, I had not entirely relied on Time Machine. Three hours earlier, immediately before lying down for my nap, I had used a unix command similar to
tar -cvf /BACKUPS/2014-11-24-072712-all-Jovin.tar Jovin gzip -v /BACKUPS/2014-11-24-072712-all-Jovin.tar Jovinto make a backup of the entire directory, over 3 years' work. The resulting *.gz file was 198M. From this file I restored the entire project. Peace is now restored, with no thanks to Apple Macintosh:
~/Documents/Rstuff/Jovin> find . -type f | wc 2435 2435 154963 ~/Documents/Rstuff/Jovin>
What if my entire internal HD had failed, which held my 2014-11-24-072712-all-Jovin.tar.gz? I would have been s--- out of luck.
I have turned off Time Machine, detached the Time Machine disk from my computer, and used a different, non-Mac command to back up the entire computer to a new external hard drive.
Now, what was wrong with the file that caused Time Machine to fail? Here are the permissions on the file, from the restored directory:~/Documents/Rstuff/Jovin> date Mon Nov 24 13:53:34 EST 2014 ~/Documents/Rstuff/Jovin> find . | egrep 182847 | xargs ls -latT -rw-r--r--@ 1 qqt staff 240334 May 3 18:30:25 2013 ./Snapshots_Backup/2013-05-03-182847-Console.txt -rw-r--r-- 1 qqt staff 608131 May 3 18:30:15 2013 ./Snapshots_Backup/2013-05-03-182847-endOfDay-GlobalEnv.RData -rw-r--r-- 1 qqt staff 141386 May 3 18:29:42 2013 ./Snapshots_Backup/20130503Fri182941-2013-05-03-182847-Sweave-Jovin.tar.gz ~/Documents/Rstuff/Jovin>You see that, of course, I did have read permission on the file. But Time Machine still couldn't handle it.