PowerShell script exchange
Post Reply
jhladish
Influencer
Posts: 11
Liked: never
Joined: Sep 04, 2013 3:47 pm
Contact:

Add-VBRTapeFilesJob Mask parameter

Post by jhladish » Jul 30, 2014 5:23 pm

All,

I have developed a script similar to many others found here that will search a backup jobs directory path and scan for the latest VBK. I then get an array of UNC paths to the latest VBK files for all backup jobs on all repositories that new backup file to tape jobs could be created for.

The issue is this:
1. I understand that there are issues with passing a direct file through this command for the job to run off of. If I give the job a full UNC path to the latest VBK that I want to write to tape, it will create the job and then I will look at in the console and it'll show the path to the file as a folder in the files and folders for the job properties instead of a file. This is a known issue, correct?
2. With the above being a known issue, I decided that I could simply give the path to the backup folder as a whole and add a mask to backup any VBK files in the directory. I will pass the following command, and when I view the job through the console, the folder has been added correctly but the mask is missing. Is this a known issue? It's as if the mask parameter for the cmdlet doesn't recognize actually passing the file mask to the job creation.

Code: Select all

Add-VBRTapeFilesJob -name $jobname -server $ServerName -path 'E:\Backups\Domain Controller\'  -mediapool $TapeMediaPool -Masks *.vbk
Image

Any insight into this issue would be greatly appreciated. Thanks in advance everyone. Looking forward to v8 which I hear is rumored to resolve much of this tape functionality.

tsightler
VP, Product Management
Posts: 5447
Liked: 2262 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Add-VBRTapeFilesJob Mask parameter

Post by tsightler » Jul 30, 2014 6:31 pm

Silly question, have you tried placing the mask inside of quotes, I'm thinking the * might be confusing the Powershell parser since it should just be a string. I haven't tested this functionality though, but I'll try a little later.

jhladish
Influencer
Posts: 11
Liked: never
Joined: Sep 04, 2013 3:47 pm
Contact:

Re: Add-VBRTapeFilesJob Mask parameter

Post by jhladish » Jul 30, 2014 6:38 pm

Thanks for the response. Both '*.vbk' and "*.vbk" both return the same issue as posted originally.

Code: Select all

get-help add-vbrtapefilesjob -examples
Examples show -Masks for pdf files being simply:

Code: Select all

Add-VBRTapeFilesJob -name "Agreements Copy Job" -Server $server -Path "D:\agreements\signed" -MediaPool $full -MediaPoolIncremental $increment -Masks *.pdf
Seems odd I am following the exact example in the get-help example and it isn't working. I wonder if this is a cmdlet issue or something else..

veremin
Product Manager
Posts: 17000
Liked: 1455 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Add-VBRTapeFilesJob Mask parameter

Post by veremin » Jul 31, 2014 9:05 am

Both are known issues. The v8 PS snap-in should be able to boast with the revised tape PS model, though.

For now, the best approach to copy only the latest backup by tape job is to delete backups from backup console and run a new full. Otherwise, hard links should be your way to go.

Thanks.

jhladish
Influencer
Posts: 11
Liked: never
Joined: Sep 04, 2013 3:47 pm
Contact:

Re: Add-VBRTapeFilesJob Mask parameter

Post by jhladish » Jul 31, 2014 12:28 pm

Thanks for confirming my suspicions!

The original script I made actually passed a full UNC hard link to the exact VBK file that I wanted to backup and this didn't work either:

Code: Select all

$TapeMediaPool = "Full Backups (Monthly)"
$JobName = DomainControllersMonthlyFull
$server = wvbakstor
$FullUNC = 
Add-VBRTapeFilesJob -$JobName -server $server -path '\\wvbakstor\E$\Backups\Domain Controller\Domain Controller2014-07-29T173143.vbk' -mediapool $TapeMediaPool
Should this functionality work and I am doing something wrong? The $server variable is passed as a string from a different script that gives an active jobs list. Even adding the -Masks *.vbk bit to the cmdlet doesn't help either.

Thanks!

veremin
Product Manager
Posts: 17000
Liked: 1455 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Add-VBRTapeFilesJob Mask parameter

Post by veremin » Jul 31, 2014 12:57 pm

The approach I was talking about implies that the files to tape job is already created and some folder is already chosen as a target for it. Then, within the script the folder hard link gets updated to the latest .vbk, and the job is executed. Kindly, check the referenced script; might give you some clues on how the whole process should be scripted.

Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests