savewpar Command

Purpose

Finds and backs up all files belonging to a specified workload partition.

Syntax

savewpar [ -a ] [ -A ] [ -B ] [ -b Blocks ] [ -e ] [ -f Device ] [ -i | -m ] [ -N ] [ -p ] [ -v ] [ -V ] [ -X ] [ -Z ] [ -P ] WparName

Description

The savewpar command finds and backs up all files belonging to a specified workload partition (WPAR). The savewpar command uses the data file created by the mkwpardata command. This data file is located in the following directory, using the form:
/tmp/wpardata/WparName/image.data
The WparName variable reflects the name of the WPAR. The savewpar command uses this file to create a backup image that can be used by the restwpar command to re-create a workload partition. For more information, see the restwpar command.

To back up customized (not including rootvg) volume groups, see the savevg command.

Restriction: You cannot use the savewpar command to create a bootable tape. For best performance, properly end applications that open and close files frequently before you run the savewpar command.

Flags

Item Description
-a Does not backup extended attributes or NFS version 4 (NFS4) access control lists (ACLs).
-A Backs up the data management application programming interface (DMAPI) file system files.
-B Does not backup the files residing in the writable namefs-mounted file systems. The default is to include files from the writable namefs-mounted file systems in the backup.
-b Blocks Specifies the number of 512-byte blocks to write in a single output operation. If you do not specify this parameter, the backup command uses a default value for the physical device that you selected. Larger values result in larger physical transfers to tape devices. The value that you specified must be a multiple of the physical block size of the device being used.
-e Excludes files specified in the /etc/exclude.WparName file from being backed up by this command.
Tip: If you want to exclude certain files from the backup, create the /etc/exclude.WparName file, with an ASCII editor, and enter the patterns of file names that you do not want to be included in the WPAR backup image. The patterns in this file are input to the pattern-matching conventions of the grep command to determine which files is to be excluded from the backup.

All of the files are backed up relatively from the base directory (marked with the dot character ".") of the WPAR. To exclude any file or directory for which it is important to have the search match the string at the beginning of the line, use the caret character (^) as the first character in the search string, followed by the dot character (.), and the file name or directory to be excluded.

For example, to exclude all of the contents of the /tmp directory, and avoid excluding any other directories that have the /tmp in the path name, edit the exclude file to read as follows:
	^./tmp/

If the file name or the directory being excluded is a substring of another file name or directory, use the caret character (‸) followed by the dot character (.) to indicate that the search begins at the beginning of the line, or use the dollar sign ($) to indicate that the search ends at the end of the line.

-f Device Specifies the device or the file name that the image is to be stored on. The default value is the /dev/rmt0 device.
-i Creates the data file by calling the mkwpardata command.
-m Creates the data file with map files by calling the mkwpardata command with the -m flag.
-N Backs up files from writable NFS-mounted file systems in the mount group for the workload partition. By default, the command does not back up files from writable NFS-mounted file systems.
Requirement: For NFS4-mounted file systems, the local and remote system must belong to the same security domain to properly establish ownership of the files on the remote server. If this is not the case, do not use the -N flag.
-p Disables software packing of the files when they are backed up. Some tape drives use their own packing or compression algorithms.
-v Specifies the verbose mode. Lists files when they are backed up.
-V Verifies a tape backup. With the -V flag, the savewpar command verifies each file header on the backup tape and reports any reading errors when they occur.
-X Specifies that the /tmp file system should be automatically expanded if necessary.
Requirement: The -X flag is only applicable with the -i or -m flag.
-Z Specifies that the Encrypted File System (EFS) information for all the files, directories, and file systems is not backed up. The flag runs the backup command with the -Z flag.
-P Excludes files from the packing option listed in the /etc/exclude_packing directory.

Parameters

Item Description
WparName Specifies the name of the workload partition to be backed up.

Examples

  1. To back up the userwpar workload partition to the default tape drive (dev/rmt0) and create a new /tmp/wpardata/userwpar/image.data file, enter the following command:
    savewpar -i userwpar
  2. To back up the wpar2 workload partition and create map files along with a new /tmp/wpardata/wpar2/image.data file on the rmt1 device, enter the following command:
    savewpar -mf/dev/rmt1 wpar2
  3. To back up the wpar2 workload partition, exclude the files listed in the /etc/exclude.wpar2 file, enter the following command:
    savewpar -ief/dev/rmt1 wpar2
  4. To back up the my_wpar workload partition to the tape in tape drive /dev/rmt0 and then verify the readability of the file headers, enter the following command:
    savewpar -f /dev/rmt0 -V my_wpar
  5. To exclude all of the contents of the scratch directory, edit the exclude file to read as follows:
    /scratch/
  6. To exclude all of the contents of the /tmp directory, and avoid excluding any other directories that have the /tmp in the path name, edit the exclude file to read as follows:
    ^./tmp/ 
  7. To back up the wpar2 workload partition and create a new /tmp/wpardata/userwpar/image.data file to the UDFS capable device /dev/usbms0, enter the following command:
    savewpar –f /dev/usbms0 wpar2

SMIT Fast Path

  1. To create a workload partition backup, enter the following SMIT fast path:
    smit savewpar
  2. To list the contents of a workload partition backup that was created with the savewpar command, enter the following SMIT fast path:
    smit lssavewpar
  3. To restore individual files from a workload partition backup, enter the following SMIT fast path:
    smit restwpar

Files

Item Description
/tmp/wpardata/WparName /WparName.data Used where the value for the WparName is the name of the workload partition.
/etc/exclude.WparName Contains the files to be excluded from backup.