Set up an automatic host backup

Deployment options: Netezza Performance Server for Cloud Pak for Data System

To set up an automatic host backup, create a script file and two NetBackup policies.
  • The script file runs a host backup to a file system accessible from the host, and then runs a user-directed transfer of that backup to NetBackup by using the bpbackup utility.
  • For the two NetBackup policies you create, one runs the user-directed backup and the other creates an automatic schedule that runs the script.
The following contents are for the sample script, /nz/opt/backup/nphostbackup.sh.
#!/bin/bash
#
# nphostbackup.sh - perform backup of host catalog and send it
# to NetBackup.
#
# set up the user (password cached using nzpassword)
export NZ_USER=nzuser

# set up the backup filename
today=‘/bin/date +%Y%m%d‘
filename=nzhostbackup.${today}

# path to NetBackup client utilities
nbbin="/usr/openv/netbackup/bin"

# host backup to disk
/bin/bash /nz/kit/bin/nzhostbackup /nz/tmp/${filename}

# transfer backup file to NetBackup using user-directed policy
# for NPS host file system
${nbbin}/bpbackup -p nzhostbackup -w /nz/tmp/${filename}

# return success/failure status to NetBackup for the Activity Monitor
exit $?
Keep in mind the following important points for the sample script:
  • The bpbackup utility references the nzhostbackup policy, which is a NetBackup policy of type Standard. The policy includes a schedule that allows for a user-directed backup during the specified time period, and lists the Netezza Performance Server host as a client.
  • To run the script, you create a NetBackup policy of type DataStore. You can set this policy to have an automatic schedule for regular host backups. You set the frequency and time period for the backups. Ensure that the policy lists the script file in Backup Selections. The script file reference must include the full path to the backup file as you would reference it on the Netezza Performance Server host.
  • Because the script runs as root on the Netezza Performance Server host, the Netezza Performance Server user must be set inside the script by using the NZ_USER variable. The user's password must be cached by using the nzpassword utility.