Subscribe
Accepted Solution

Running a WFA backup from the Command Line

Hi,

I am trying to run a backup from the WFA Command Line:

{WFA_INSTALL}/bin/Backup.ps1 admin admin c:\TEST\Test.backup

I consistently getting the following failure:

PS C:\Program Files (x86)\NetApp\WFA\bin> ./Backup.ps1

Exception calling "backup" with "1" argument(s): "Caller unauthorized"

At C:\Program Files (x86)\NetApp\WFA\bin\Backup.ps1:16 char:38

+ $returnString = $backupService.backup <<<< ($FileName)

    + CategoryInfo          : NotSpecified: (Smiley Happy [], MethodInvocationException

    + FullyQualifiedErrorId : DotNetMethodException

Clearly my user id is valid as I can login via the portal;  

Any pointers ?

Cheers

Rich

Re: Running a WFA backup from the Command Line

Firstly you need to define a backup user with the WFA portal;  Login to WFA as admin and create a new user (I called mine "backup") and give him a role of backup; Do this via:

Tools > Users > (right click New) or Actions > New

This user is required to run the backups via the CLI (Note: you will get Unauthorised access if you try and login to the WFA portal using this user ID)

Next login into the WFA Server and launch a Command Prompt:

and run:

cd "C:\Program File (x86)\NetApp\WFA\bin"

powershell .\Backup.ps1 "backup username" "backup password" "filename for the backup"

(the command/script will return the complete filename for the backup)

Note: In order to run Powershell script on your server you may have to Enable Script Support - this post will show you how:

http://www.tech-recipes.com/rx/2513/powershell_enable_script_support/

Note 2: depending on what you tried initially you may find that PowerShell caches your credentials - if after the above your still getting un-authorised access errors;  close your command prompt window and retry

Many thanks to Dekel for helping me sort this...

Re: Running a WFA backup from the Command Line

Hello,

This is a great new feature in WFA, thank you!

One thing I'd like to ask is does anyone know how I could append a date string to this backup file name?  This would enable me to run this from a backup program like Netbackup and easily add a new file each day.  Thanks!

-Dave

Re: Running a WFA backup from the Command Line

You cold wrap the command above into a batch or power shell script and pass a date string to the output file name

I'll see if I can whip up a script to do this in the next couple of days