I have a files to tape job, I need to recover ~1500 files from tape.
I'd like to be able to feed this list into a restore job via powershell (I will cry if I need to use the gui.)
-
- Enthusiast
- Posts: 83
- Liked: 9 times
- Joined: Oct 31, 2013 5:11 pm
- Full Name: Chris Catlett
- Contact:
-
- Enthusiast
- Posts: 83
- Liked: 9 times
- Joined: Oct 31, 2013 5:11 pm
- Full Name: Chris Catlett
- Contact:
Re: script to restore list of files from tape -Files to Tape
I tried the following:
Code: Select all
$files = gc "C:\sql_files_to_restore.txt"
Start-VBRTapeRestoreFiles -Files $files -Server milivvbackup01 -Path s:\ -PreserveHierarchy -Security -RunAsync
-
- Product Manager
- Posts: 20413
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: script to restore list of files from tape -Files to Tape
As mentioned in User Guide, -Files should be of CatalogueFile type. And Tape Catalogue can queried via obsolete Find-VBRTapeCatalog commandlet. Thanks.
-
- Enthusiast
- Posts: 83
- Liked: 9 times
- Joined: Oct 31, 2013 5:11 pm
- Full Name: Chris Catlett
- Contact:
Re: script to restore list of files from tape -Files to Tape
So, I guess I'm looking for some help on how to write this script.
I have a list of the files that need to be restored, do I need to run each file through a for-each loop through the find-vbrtapecatalog cmdlet and build an array or custom object?
I need to be able to feed in the script, and be told what tapes are needed and have a single restore job created.
Due to the number of files, this isn't something I can do through the gui.
I have a list of the files that need to be restored, do I need to run each file through a for-each loop through the find-vbrtapecatalog cmdlet and build an array or custom object?
I need to be able to feed in the script, and be told what tapes are needed and have a single restore job created.
Due to the number of files, this isn't something I can do through the gui.
-
- Product Manager
- Posts: 20413
- Liked: 2302 times
- Joined: Oct 26, 2012 3:28 pm
- Full Name: Vladimir Eremin
- Contact:
Re: script to restore list of files from tape -Files to Tape
Correct. For each file you will need to take its name from .txt, locate the file in catalog, using Find-VBRTapeCatalog cmdlet, add it to an array of CatalogueFile type. After that, execute restore.Do I need to run each file through a for-each loop through the find-vbrtapecatalog cmdlet and build an array?
Thanks.
Who is online
Users browsing this forum: No registered users and 7 guests