PowerShell script exchange
Post Reply
leeg123
Enthusiast
Posts: 40
Liked: 2 times
Joined: Dec 13, 2010 12:50 am
Full Name: lee garet
Contact:

backup report

Post by leeg123 »

Although a former assembly language coder back in my day, I am extremely new at PowerShell. Ive managed to figure out enough to be dangerous
Anyway so far I’ve browsed through several scripts that I had found for backup reports, but I must say, the daily email notification that veeam generates will definitely work for me.
My question, is there any way to manually generate a similar backup report using PowerShell? Does the daily backup report that gets emailed to us ever get saved to the local veeam server. Maybe we can just reuse that file.
The ultimate goal is for us to combine a post activity job script that will
1 copy the backup files onto removable hard disks via Robocopy
2 email us a daily backup report and include the robocopy log file

We figured out already how to email the log file that robopy generates , but we wanted to combine that email with the veeam backup report. I would prefer not to have two emails per customer, but instead a single email with the daily backup report, and include the robocopy log file as well

Any help would certainly be appreciated.

Thanks

Lee
Vitaliy S.
VP, Product Management
Posts: 27112
Liked: 2719 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: backup report

Post by Vitaliy S. »

Hi Lee,
leeg123 wrote:Anyway so far I’ve browsed through several scripts that I had found for backup reports, but I must say, the daily email notification that veeam generates will definitely work for me.
Are you referring to daily backup job status report that is generated by our Backup Enterprise Manager?

Thanks!
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: backup report

Post by veremin »

Hi, Lee.

There are topics that might help you in your understanding how to script the process.

Two topics regarding PowerShell reporting.

http://forums.veeam.com/viewtopic.php?f=26&t=13422
http://forums.veeam.com/viewtopic.php?f=26&t=8925

Note: You can input the body of your code responsible for sending Robocopy-logs to one of the scripts mentioned in these topics, thus, you’ll meet your expectations of having single email with the daily report.

PowerShell and Robocopy.

http://forums.veeam.com/viewtopic.php?f=2&t=1093

Note: Please, be aware that you can only specify *cmd,*exe or *bat files as the job post-activity. So, you’ll have to either convert you powershell script into a batch file (powershell-script-in-a-bat-file) or just execute your PowerShell script from a batch file, using the following command:

Code: Select all

Powershell.exe -File C:\YourScript.ps1
Additionally, this is the way how you can set a post-job activity by the means of PowerShell:

Code: Select all

asnp VeeamPSSnapin

$Job = Get-VBRJob | ?{$_.Name –eq “Name of the your job”}
$jo = $job.GetOptions()
$jo.PostJobCommand.Enabled = $True
$jo.PostJobCommand.Commandline = "D:\Test.bat" 
$job.SetOptions($jo)
Note: “D:\Test.bat” is just an example; you should input your own directory, where your bat-file is located

Hope this helps.
Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests