Active IQ Unified Manager Discussions

Prot Mgr - post backup script

kutner
5,977 Views

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!

6 REPLIES 6

jmc
5,977 Views

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
5,977 Views

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
5,977 Views

Correction: "man dfpm"

kutner
5,977 Views

Thanks!

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

jmc
5,977 Views

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

Cheers,

Jonathan

kutner
5,977 Views

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);

Public