Prescripts and postscripts

Contributors netapp-soumikd

You can use custom prescripts and postscripts as part of your data protection operations. These scripts enable automation either before your data protection job or after. For example, you might include a script that automatically notifies you of data protection job failures or warnings. Before you set up your prescripts and postscripts, you should understand some of the requirements for creating these scripts.

Supported script types

The following types of scripts are supported for Windows:

  • Batch files

  • PowerShell scripts

  • Perl scripts

The following types of scripts are supported for UNIX:

  • Perl scripts

  • Python scripts

  • Shell scripts

    Note Along with default bash shell other shells like sh-shell, k-shell, and c-shell are also supported.

Script path

All prescripts and postscripts that are run as part of SnapCenter operations, on nonvirtualized and on virtualized storage systems, are executed on the plug-in host.

  • The Windows scripts should be located on the plug-in host or on a SMB share accessible by the plug-in host.

  • The UNIX scripts should be located on the plug-in host.

Note The script path is validated at the time of execution.

Where to specify scripts

Scripts are specified in backup policies. When a backup job is started, the policy automatically associates the script with the resources being backed up. When you create a backup policy, you can specify the prescript and postscript arguments.

Only for Windows, you can specify multiple scripts. You should press Enter after each script path to list each script on a separate line. Semicolons (;) are not allowed. You can specify multiple prescripts and multiple postscripts. A single script can be coded as both a prescript and a postscript and can call other scripts.

Note For UNIX, you cannot specify multiple scripts.

Script timeouts

For Windows, the timeout is set to 15 minutes and cannot be modified.

For UNIX, the timeout is set to 60 seconds, by default. You can modify the timeout value.

Script output

The default directory for the Windows prescripts and postscripts output files is Windows\System32.

There is no default location for the UNIX prescripts and postscripts. You can redirect the output file to any preferred location.