Command-line access for Apple Time Machine?
We use Apple's Time Machine to back up our Apple 10.5.8 workstations at the office.
If I want to restore a file, I need to open up the Time Machine GUI and browse files there. The GUI is ugly eye-candy and gets in my way.
Is there a way to browse the Time Machine archive using the Mac's command-line?
I'm used to Netapps and other storage appliances. I use backintime for my Ubuntu workstation. To restore a file with one of those systems, you can restore a file with a simple command like:
cp .snapshot/daily.0/filename.txt .
or
cp /backup/backintime/20100611-000002/backup/etc/shadow /etc/shadow
Is there an equivalent for Apple's Time Machine?
Solution 1:
Putting my comment as an answer. An intermediate solution would be to use Finder to browse the Time Machine backups just like a regular folder. If you want to browse it in the command line, drag the folder from the Finder to the Terminal window so that you don't need to hunt through the many levels of directories that Time Machine sets up. Enjoy!
Solution 2:
Restoring a backup from command-line can be done with the tmutil
command:
tmutil restore <complete path to snapshot> <path to restore>
For example:
sudo tmutil restore /Volumes/TimeMachine/Backups.backupdb/Server/2013-03-18-002707/Boot\ HD/Users/me/Documents/loveletter.doc loveletter.doc
Will restore your love letter from the backup on March 18th.