Schedule backup on DataCore nodes. Email,copy the backup job

Create Backup.ps1 file on every datacorenode. Under C:\backup

Create backup.bat file on every datacorenode. Under C:\backup

Schedule a task in Datacore to run below powershell script and the backup.bat on every node. The Powershell needs only on one node. The script solves that for you.

 

Backup.bat

net use \\1.1.1.1\h$ /user:user password
copy C:\Backup\* \\2.2.2.2\h$\Datacore\
net use \\1.1.1.1.\h$ /delete /y
exit

-Backup.ps1-

Import-Module “C:\Program Files\DataCore\SANsymphony\DataCore.Executive.Cmdlets.dll” -WarningAction:SilentlyContinue

Connect-DcsServer -Server DATACORE-SERVER -UserName user -Password password -Connection DCNode1

$servers = Get-DcsServer

Set-DcsBackUpFolder -Server $servers[0] -Folder “C:\Backup\”
Set-DcsBackUpFolder -Server $servers[1] -Folder “C:\Backup\”

Backup-DcsConfiguration

Send-MailMessage -SmtpServer 1.1.1.1 -From “datacore@customer.com” -To “monitor@installer.com” -Subject “DataCore Backup – Customer” -Body “Backup done.”

Disconnect-DcsServer -Connection DCNode1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.