Use > Server patching > Patch management for Unix > Set uninstall options > Pre-installation and post-installation scripts

Specifying pre-installation and post-installation scripts

For each patch, you can specify a command or script to run before uninstallation or after uninstallation. A pre-uninstall script, for example, could check a certain condition on the managed server. If the condition is not met or if the pre-uninstall script fails, the patch would not be removed from a server. A pre-uninstall script could also be used to shut down a service or application before it is removed from a server. A post‑uninstall script could be used to perform a certain cleanup process on the managed server.

You can specify the following types of scripts to run on the managed server before or after a patch uninstallation:

  • Pre-uninstall: A script that runs before the patch is removed from a managed server.
  • Post-uninstall: A script that runs after the patch is removed from a managed server.

To specify a script:

  1. In the Uninstall Patch window, click Next to advance to the Pre & Post Actions step.
  2. Select the Pre-Uninstall or Post-Uninstall tab.

    You may specify different scripts and options on each of the tabs.

  3. Select Enable Script.

    This option enables the remainder of the fields on the tab. If Enable Script is not selected, the script will not run.

  4. Select either Saved Script or Ad-Hoc Script.

    A Saved Script has been previously stored in Server Automation with the SA Client. To specify the script, click Select.

  5. If the script requires command-line flags, enter the flags in Commands.

  6. Specify the information in the Runtime Options. If you choose a user account other than root, enter the User Name and Password. The script will be run by this user on the managed server.

  7. To stop the uninstallation if the script returns an error, select Error.