PowerShell script exchange
Post Reply
chrisdearden
Veteran
Posts: 1531
Liked: 226 times
Joined: Jul 21, 2010 9:47 am
Full Name: Chris Dearden
Contact:

One Liner to update all jobs to optimal.

Post by chrisdearden » 4 people like this post

So you've just upgraded your VBR install to v7 - but now all of your jobs are using the old compression level , which is now High. If you want to take advantage of the new compression levels ( slightly less compression but vastly reduced Proxy CPU consumption ) and make that parallel processing really go at its best , you will have to reset the compression level for all of your jobs. Of course if you have compression disabled or set to other options this might not be required , but if you do have a lot of jobs to update , this little one-liner in powershell should make the job a little shorter.

Code: Select all

Get-VBRJob|Set-VBRJobAdvancedStorageOptions -CompressionLevel 5
Don't forget to run a full backup on each job to take advantage of the new settings.
Andreas Neufert
VP, Product Management
Posts: 6707
Liked: 1401 times
Joined: May 04, 2011 8:36 am
Full Name: Andreas Neufert
Location: Germany
Contact:

Re: One Liner to update all jobs to optimal.

Post by Andreas Neufert »

Cool, thank you.
jmcelvoy
Novice
Posts: 7
Liked: never
Joined: Mar 14, 2012 9:34 pm
Full Name: Jason McElvoy
Contact:

[MERGED] : Modify settings of all replication jobs

Post by jmcelvoy »

In troubleshooting a problem I've been having, the tech had me change all my jobs to Compression=Dedupe-Friendly and Storage Optimization =WAN. I've since found that all my jobs run substantially faster with Compression=Optimal and Storage Optimization=LAN. Can I script changing this on all my jobs at the same time vs editing each job individually?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: One Liner to update all jobs to optimal.

Post by veremin »

Hi, Jason. The following script should answer your requirements:

Code: Select all

asnp VeeamPSSnapin
Get-VBRJob | ?{$_.jobtype -eq "Replica"} | Set-VBRJobAdvancedStorageOptions -CompressionLevel 5 -StorageBlockSize KbBlockSize512 
Hope this helps.
Thanks.
jmcelvoy
Novice
Posts: 7
Liked: never
Joined: Mar 14, 2012 9:34 pm
Full Name: Jason McElvoy
Contact:

Re: One Liner to update all jobs to optimal.

Post by jmcelvoy »

Thanks for the info. This will get me going in the right direction hopefully.
Is there a way to see the settings for my jobs? I run a get-vbrjob | get-vbrjoboptions and all the output is Veeam.Backup.Model.CDomsomething. I need to see which of my jobs are set to Dedupe-Friendly with WAN target as I had a co-worker modify some of the jobs to see if that helped performance. Now I have no clue which jobs have been modified.
jmcelvoy
Novice
Posts: 7
Liked: never
Joined: Mar 14, 2012 9:34 pm
Full Name: Jason McElvoy
Contact:

Re: One Liner to update all jobs to optimal.

Post by jmcelvoy »

In playing around with this, if I set -compressionLevel 6, it sets my job to High. If I do 7 or 8, it sets it back to Optimal. Can I somehow view my jobs compressionlevel? Also, on your example, what does -StorageBlockSize kbBlockSize512 do for my jobs?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: One Liner to update all jobs to optimal.

Post by veremin »

Is there a way to see the settings for my jobs?
You can output the job options, using the following script:

Code: Select all

asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Replication Job 1"
$Job.GetOptions()
The result still will be something similar to [Veeam.Backup.Model.CDomBackupStorageOptions]. The specific job options can be gotten with the usage of “.”. For instance, in order to see the backup storage options you will have to run this script:

Code: Select all

asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Replication Job 1"
$Job.GetOptions().Backupstorageoptions 
I need to see which of my jobs are set to Dedupe-Friendly with WAN target as I had a co-worker modify some of the jobs to see if that helped performance
Anyway, if you’re willing to list all replication jobs that have “dedupe-friendly” and “WAN target” settings you should use this one-liner:

Code: Select all

Get-VBRJob | where {($_.jobtype -eq "Replica") -and ($_.Backupstorageoptions.StgBlockSize -eq "KbBlockSize256") -and ($_.Backupstorageoptions.CompressionLevel -eq 4)}  
Hope this helps.
Thanks.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: One Liner to update all jobs to optimal.

Post by veremin »

Can I somehow view my jobs compression level?
The number equivalents of compression levels are as the following:

Code: Select all

0 – “none”
4 – “dedupe-friendly”
5 – “optimal”
6 – “High”
9 – "Extreme"
Also, on your example, what does -StorageBlockSize kbBlockSize512 do for my jobs?
It sets “LAN Target” as a storage optimization level. Thanks.
pknaap
Novice
Posts: 3
Liked: never
Joined: Feb 18, 2013 12:19 pm
Contact:

Re: One Liner to update all jobs to optimal.

Post by pknaap »

THX , saved some work!
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests