PowerShell script exchange
Post Reply
Michael1337
Novice
Posts: 8
Liked: never
Joined: Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk
Contact:

Starting / Stoping Backup Skript

Post by Michael1337 »

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
Novice
Posts: 8
Liked: never
Joined: Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk
Contact:

Re: Starting / Stoping Backup Skript

Post by Michael1337 »

Please, can u just tell me, how do i write Skript, to start my existing Backup Job?

Gostev
SVP, Product Management
Posts: 27144
Liked: 4450 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Starting / Stoping Backup Skript

Post by Gostev »

Code: Select all

Get-VBRJob | where {$_.name -eq "JOBNAME"} | Start-VBRJob

Michael1337
Novice
Posts: 8
Liked: never
Joined: Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk
Contact:

Re: Starting / Stoping Backup Skript

Post by Michael1337 »

Thank you very much, finally i know how to realize :D

Gostev
SVP, Product Management
Posts: 27144
Liked: 4450 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Starting / Stoping Backup Skript

Post by Gostev »

Glad to help, please also check out the latest User Guide, as it has a good section on PowerShell - including some useful usage examples.

Michael1337
Novice
Posts: 8
Liked: never
Joined: Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk
Contact:

Re: Starting / Stoping Backup Skript

Post by Michael1337 »

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?

Alexey D.

Re: Starting / Stoping Backup Skript

Post by Alexey D. »

Hello Michael,

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

Michael1337
Novice
Posts: 8
Liked: never
Joined: Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk
Contact:

Re: Starting / Stoping Backup Skript

Post by Michael1337 »

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.

Gostev
SVP, Product Management
Posts: 27144
Liked: 4450 times
Joined: Jan 01, 2006 1:01 am
Location: Baar, Switzerland
Contact:

Re: Starting / Stoping Backup Skript

Post by Gostev »

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.

Michael1337
Novice
Posts: 8
Liked: never
Joined: Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk
Contact:

Re: Starting / Stoping Backup Skript

Post by Michael1337 »

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.

Alexey D.

Re: Starting / Stoping Backup Skript

Post by Alexey D. »

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.

Michael1337
Novice
Posts: 8
Liked: never
Joined: Dec 17, 2010 12:28 pm
Full Name: Michael Leonczyk
Contact:

Re: Starting / Stoping Backup Skript

Post by Michael1337 »

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

:-)

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests