Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TIP: bpexpdate -recalculate, was able to script it 1

Status
Not open for further replies.

Cstorms

IS-IT--Management
Sep 29, 2006
556
US
Considering this command expects you to manually input a "y/n", and you may need to do more than 1 at a time (duh!?) I wrote something in powershell to help a person out!

Also, I used the built in "Images on Media" within NetBackup 6.5 client and exported that data to a txt file and used Excel to get the relevant backup IDs to a manageable format.

Pre Reqs:
-csv file with a BackupID column
-a file called y.txt with the letter "y" in the first line (or run "echo y > c:\y.txt" in a batch file)

It loops each result with the following command (i moved the admincmd folder to a shorter path so it wouldnt choke on the length of the string).

$backupid = Import-Csv c:\powershell\WhatsLeft.csv | foreach-object {$_.BackupID}

foreach($id in $backupid) {


cmd /c "D:\CMDS\bpexpdate.exe -recalculate -backupid $id -ret 11 -sched 0 < c:\y.txt"

}

Cory
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top