Subscribe

Prot Mgr - post backup script

How can I setup Protection Manager to run a script after a backup has been completed?

In the protection policy window it shows 'backup script' but I thought that ran before the backup was executed (since it shows that on the primary node). I'd like to run a script after the backup is complete.

Specifically after I do a 'remote backup' of a dataset, I'd like to call a script to tell my tape backup software to run a tape backup of the remote data. So I'll need to have the snapshot name passed along as well.

Thanks!

jmc

Re: Prot Mgr - post backup script

The script will be invoked several times, each time with an ENV that tells you whether it's before or after backup. Test that ENV to decide what to do (nothing or something) based on which point in the process the script got called.

Jonathan

jmc

Re: Prot Mgr - post backup script

See section "PRE- AND POST-PROCESSING SCRIPTS FOR DATA TRANSFERS" in the "man dfm" pages for more info.

ENV you want is called DP_BACKUP_STATUS

Cheers,

Jonathan

jmc

Re: Prot Mgr - post backup script

Correction: "man dfpm"

Re: Prot Mgr - post backup script

Thanks!

Where's the docs on a Windows box? 'man' doesn't work Smiley Happy

jmc

Re: Prot Mgr - post backup script

It's in the "Start" button > Programs > NetApp > DataFabric Manager > Man Pages.

Cheers,

Jonathan

Re: Prot Mgr - post backup script

Thanks, got all of the information I needed.

To round out this topic, I'm posting a simple script that can show all of the variables each time the script runs. This template can be used for both provisioning and protection policies. It's in the man pages, but here is the whole script:

#

# This is in Perl

#

# timestamp

$file="C:\\scripts\\log.txt";

$time = localtime;
open(DAT, ">> $file") || die("Cannot Open File");
print DAT "$time\n"; close(DAT);


open(DAT,">> $file") || die("Cannot Open File");

# loop through the Provisioning environment variables
foreach $key (sort(keys %ENV))
{
if ($key =~ /^PM_/) {
print DAT "$key: $ENV{$key}\n";
}
}

# loop through the Protection environment variables

foreach $key (sort(keys %ENV))
{
if ($key =~ /^DP_/) {
print DAT "$key: $ENV{$key}\n";
}
}


close (DAT);

# timestamp

$time = localtime;
open(DAT,">>$file") || die("Cannot Open File");
print DAT "$time\n"; close(DAT);