When using TSM as your backup solution, the GUI is not the fastest way to do your restore. IBM even recommends using the command line when restoring a large amount of data. So, let’s do that.
The syntax for dsmc is not the easiest to remember, for example, to restore all under D:\Data this would be the command for the latest version.
C:\Program Files\Tivoli\TSM\baclient\dsmc.exe restore -inactive -subdir=yes D:\Data\* E:\Restore\
or, to restore from last week it would look like this
C:\Program Files\Tivoli\TSM\baclient\dsmc.exe restore -inactive -subdir=yes -pitd=04/07/17 D:\Data\* E:\Restore\
Let’s simplify this with a PowerShell wrapper.
Restore-TSMBackup.ps1
1 2 |
Restore-TSMBackup.ps1 -From "D:\Data" -To "E:\Restore" Restore-TSMBackup.ps1 -From "D:\Data" -To "E:\Restore" -PointInTime '04/07/17' |
I’m using Start-Process to run dsmc, this allows me to redirect the output. I’ve chosen to put it in a text file in the Temp folder.
When the restore is completed, read the file and show the summary.
The script is available on GitHub