How To Restore Files From The TSM Backup Using CLI
How To Restore Files From The TSM Backup Using CLI
You can restore files from the backup yourself using the Command Line Interface in
Terminal.app. This is slightly more tricky than using the GUI: primarily, you more or less
need to know the name of the file you are looking for. Two sources of information
that can help is the daily logs in /CS/Backup (user readable) or the master log
located in /Library/Logs/tivoli/tsm/dsmsched.log (readable by root only).
These files include every file that has been backed up (note that these log files are trun-
cated after 30 days). Once you do have the filename, CLI restore is pretty simple. Note
that the dsmc program doesn't use backspace; use ctrl-h instead!
Restore, like backup, can be performed from any location; all you need is an internet
connection and port 1500 open in any firewall you might encounter.
Files are stored for a year and backup is performed daily (if computer is awake and have
an IP-address). Versions of backed up files are stored for one year. The most recent
version of every file that has not been deleted will always remain, irrespective of it's
age. Deleted files can be restored from the back up for up to one year.
NOTE: You need to know the name and password of an administrative user!!
1. Become root:
$ su adminusername
Enter admin user password
$ sudo -i
Enter admin user password again
2. Launch dsmc:
$ dsmc
3. When you are done, leave dsmc:
tsm> quit
Restore a single file, using the most recent backup, placing it in the original location:
restore "/Users/peter/Documents/My Thesis.rtf"
if the file name contains spaces, it must be surrounded by quotes!
Look for files from a specific date (pitd=Point In Time Date) and pick among those:
restore -pitd=2012-06-15 -subdir=yes "/Users/peter/*dmg" -pick
/Restored/
You will get a listing such as this that you can choose from
--------------------------------------------------------------------------------------
1. | 2012-06-15 09:56:41 72 B I /Users/peterm
2. | 2011-09-13 10:15:22 72 B A /Users/peterm/InstaDMG/
3. | 2011-09-13 10:16:55 72 B A /Users/peterm/InstaDMG/Resources
4. | 2011-09-13 10:16:55 72 B A /Users/peterm/InstaDMG/Resources/Instadmg
|
|
|
0---------10--------20--------30--------40--------50--------60--------70--------80----
<U>=Up <D>=Down <T>=Top <B>=Bottom <R#>=Right <L#>=Left
<G#>=Goto Line # <#>=Toggle Entry <+>=Select All <->=Deselect All
<#:#+>=Select A Range <#:#->=Deselect A Range <O>=Ok <C>=Cancel
pick>
All these commands can be run without actually starting dsmc; in that case just
proceed the commands above with dsmc!