Starting / Stoping Backup Skript

PowerShell script exchange

Starting / Stoping Backup Skript

Veeam Logoby Michael1337 » Fri Dec 17, 2010 12:36 pm

Hi Guys, i fight now 3 Days with this Problem:
#
First of all i created 2 Jobs in Wizard.
1. for Backup Job,
2. for Continuously Replication Job.



I want to have 2 Scripts:
___________________________________________
1.
Stop (existing) Replication Job (it's continiuously)
Start (existing) Backup Job


2.
Start (existing) Replication Job (it's continiuously)
___________________________________________

The Problem is, i study user guide: Powershell acces, but i cant realize how to start the BackupJob i allways get Errors:
So when i want to Start my Backup Job first of all:

(USER GUIDE:)
Start-VBRJob
This cmdlet allows you to start a created job.
Syntax
Start-VBRJob [Name <Object []>]

I write in Skript:

Add-PSSnapin VeeamPSSnapIn
Start-VBRJob Backup_Fileserver
Backup_Fileserver is the Name of the Job.

What do i wrong ?
Michael1337
Service Provider
 
Posts: 8
Liked: never
Joined: Fri Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk

Re: Starting / Stoping Backup Skript

Veeam Logoby Michael1337 » Fri Dec 17, 2010 1:14 pm

Please, can u just tell me, how do i write Skript, to start my existing Backup Job?
Michael1337
Service Provider
 
Posts: 8
Liked: never
Joined: Fri Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk

Re: Starting / Stoping Backup Skript

Veeam Logoby Gostev » Fri Dec 17, 2010 1:25 pm

Code: Select all
Get-VBRJob | where {$_.name -eq "JOBNAME"} | Start-VBRJob
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Starting / Stoping Backup Skript

Veeam Logoby Michael1337 » Fri Dec 17, 2010 2:18 pm

Thank you very much, finally i know how to realize :D
Michael1337
Service Provider
 
Posts: 8
Liked: never
Joined: Fri Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk

Re: Starting / Stoping Backup Skript

Veeam Logoby Gostev » Fri Dec 17, 2010 2:40 pm

Glad to help, please also check out the latest User Guide, as it has a good section on PowerShell - including some useful usage examples.
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Starting / Stoping Backup Skript

Veeam Logoby Michael1337 » Mon Dec 20, 2010 12:10 pm

Hi again,
i got another problem now:

when i stop my (continuosly) Replication job by powershell
PS C:\Users\Administrator> Get-VBRJOB | where {$_.name -eq "MLREP"} | Stop-VBRJob

Veeam stop my job for a moment, but it goes on and starts replication again.

I need to stop my continously replication job, so i can start my backup job next by script.

Thats my script:
Add-PSSnapin VeeamPSSnapIn
Get-VBRJOB | where {$_.name -eq "MLREP"} | Stop-VBRJob
Get-VBRJOB | where {$_.name -eq "MLBU"} | Start-VBRJob
... but he starts both Jobs, and fails :-(

What do i wrong?
Michael1337
Service Provider
 
Posts: 8
Liked: never
Joined: Fri Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk

Re: Starting / Stoping Backup Skript

Veeam Logoby Alexey D. » Mon Dec 20, 2010 12:38 pm

Hello Michael,

What are your schedule options for that replication job?
It looks like the job gets started by scheduler.
Alexey D.
 

Re: Starting / Stoping Backup Skript

Veeam Logoby Michael1337 » Mon Dec 20, 2010 12:49 pm

Yes, thats right.

I want to start this script 1 x day at 23:00 o'clock by Microsoft Task Scheduler.

When this BackupJob is completed, it starts the next script to start Replication Job.
So i want 2 have a continously replication, and 1 x a day 1 Backup job.
Michael1337
Service Provider
 
Posts: 8
Liked: never
Joined: Fri Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk

Re: Starting / Stoping Backup Skript

Veeam Logoby Gostev » Mon Dec 20, 2010 1:30 pm

I guess then your script must also disable continuous replication, otherwise the stopped job will be just started immediately. Or better yet you could use periodic schedule, and use backup window UI control to set the job not to replicate while the backup job is running.
Gostev
Veeam Software
 
Posts: 21390
Liked: 2349 times
Joined: Sun Jan 01, 2006 1:01 am
Location: Baar, Switzerland

Re: Starting / Stoping Backup Skript

Veeam Logoby Michael1337 » Tue Dec 21, 2010 8:26 am

Or better yet you could use periodic schedule, and use backup window UI control to set the job not to replicate while the backup job is running.


i checked, but i couldnt find it in the Gui. Where do i find it ? Please tell me.
Michael1337
Service Provider
 
Posts: 8
Liked: never
Joined: Fri Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk

Re: Starting / Stoping Backup Skript

Veeam Logoby Alexey D. » Tue Dec 21, 2010 9:03 am

Michael,

Navigate to Job schedule step and choose Periodically every: radiobutton. Then click Schedule... button and in Time periods window which shows up, exclude some hours from replication process - that will be a window for your backup job.
Alexey D.
 

Re: Starting / Stoping Backup Skript

Veeam Logoby Michael1337 » Tue Dec 21, 2010 10:38 am

Ah ok, i know this Point, but if i use that, i have no conitniously Replication / Backup :-)
but thats no problem, i realized it now finally like that:


Image

:-)
Michael1337
Service Provider
 
Posts: 8
Liked: never
Joined: Fri Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 5 guests