Solstice Backup 5.1 Administration Guide

Data Management

This section provides a command line reference for Backup commands to use for data management. Many of these commands are also automatically invoked by the Backup server during scheduled backups. The commands for HSM and Archive are only available when you enable the optional modules for these features on the Backup server.

savegrp

The savegrp program runs a group of Backup clients through the save process to back up filesystem data. The group of clients is selected by the name assigned (see "NSR group "). Typically, savegrp is invoked automatically, as specified by each group's NSR group resource.

If you do not specify a group name, the Backup group named Default is used. If you specify a group name, clients whose nsr_client resources specify the named group in their Group attribute are included. If you specify an explicit client list with the -c client-name option, the savegrp program only includes the named clients in the backup and ignores other members of the group.

If you enable the Clone attribute for the named group, the savegrp program automatically invokes a clone of the save sets backed up during the save session. The client save sets and their associated file indexes are cloned before the bootstrap save set is generated, which allows the bootstrap to track both the original save sets and their clones. The bootstrap save set is cloned as well. Cloned save sets are sent volumes assigned to the clone pool specified in the NSR group resource.

If a client's Save Set attribute specifies "All," the savegrp program requests a list of the filesystems to perform the save program on (this is called a probe). The probe expands "All" into a list by searching for local and automatically mounted filesystems on the client machine (NFS mount points and manually mounted filesystems are generally not included in the list gathered by the probe).

You cannot run more than one occurrence of the savegrp program on the same group at the same time; the program exits with an error message. If you run different groups at the same time, each group runs save program sessions up to the limit specified in the Parallelism attribute for the nsr_client resource (the default value for Parallelism is 4). However, the Backup server only allows save program sessions up to the limit specified in the server's Parallelism attribute to write to one backup device at a time. Each save set generates a separate save program session, regardless of the client it originates from.

When the save process (and, if enabled, clone process) is complete, a notification with an Event value of "savegrp" and a Priority value of "notice" is sent to the nsr_notification system. This is generally set up to send e-mail to the root user to indicate the success or failure of the backup, the clients backed up during the savegrp execution, and the data saved.

The following example describes the format and options available for the savegrp program:


savegrp [see "Options"] [-R | -G] [group-name]

Options:


[-EIOmnpv] [-l level | -C schedule]

[- e expiration] [- t date] [-r retries]

[-P printer] [-W width] [-c client [-c client...]]

save

The save program, which resides on each Backup client, saves files. You can monitor the progress of a save operation using the X Window System-based nwadmin program or the curses (3X)-based nsrwatchAdministration program.

If you do not specify a path argument either on the command line or through the -I option, the current directory that save is invoked from is saved. The save program saves a directory by saving all the files and subdirectories it contains. The save program does not cross mount points, and it does not follow symbolic links. If you mount the paths indicated from a network file server, the save program instructs you to run the save program on the remote machine, or use the -L option.

Each file in the subdirectory structures specified by the path option is encapsulated in a Backup save stream. This stream of data is sent to a receiving process on the Backup server, which processes the data and adds entries to the client file index for each file in the stream. The data is then directed to long-term storage, either on the server or the designated storage node.


Caution - Caution -

The server's bootstrap and the client file indexes are only backed up automatically during a scheduled or manual backup that invokes the savegrp program. If you never run the savegrp program, either a scheduled or manually invoked backup, you do not have the server bootstrap or client file indexes that are vital to the disaster recovery process.


The following example describes the format and options available for the save program:


save [-BEiLnqvx] [-s server] [-c client-name]

[- N name] [-e expiration] [-f directory-file]

[-b pool] [-F file] [-I input-file] [-g group]

[-l level] [-t date] [-m masquerade] [-W width]

[path...]

savefs

The savefs program is used by the savegrp program to probe a client for its filesystems and recent save times. Running savefs directly to perform a save is not recommended. However, you can safely invoke savefs manually with the -p option to probe the client and produce a preview report of the save sets (and levels) that a savegrp will back up. When probing, savefs does not actually save data, but instead produces a machine-parsable report that describes the layout of the client's filesystems. The -p option provides command line access to the same information you obtain with the Group Control>Preview feature available in the GUI version of the Administration program.

If a filesystem argument is not provided with the savefs command line, the filesystems listed in the Save Set attribute are probed. If the save set list consists of the keyword "All," then the filesystem tables (/etc/vfstab on Solaris)are examined to determine which filesystems to save. Only local, mounted filesystems are considered by the probe.

Metadevices within the Sun Solaris: Online DiskSuite are treated similar to independent disks. This approach allows each to be saved in its own session, assuming sufficient parallelism.

Care should be taken when the Clients resource explicitly lists the save sets, for two primary reasons. First, this list must be manually updated when new filesystems that need saving are added. Second, since savefs only stops at the end of a path or a mount point, if you list two save sets in the same filesystem and one is a subdirectory of the other, the subdirectory is saved twice.

You can specify filesystem arguments to limit the filesystem saves to only those specified, but the specified filesystems must appear on a Save Set list for this client (see the -F option).

The following example describes the format and options available for the savefs program:


savefs -p [options] [filesystem...]

[-M filesystem...]

The following lists the valid values for options:


[-BEFnpqRv] [-s server] [-N name] [-g group]

[-l level | -C schedule] [-e expiration]

[-f filename] [-W width] [-t date] [-T seconds] 

savepnpc

The savepnpc program, like the save program, saves files to long-term storage. Before performing a save operation, savepnpc performs any pre-processing commands that exist in the /nsr/res/group_name.res file. If the pre-processing command fails, savepnpc exits with an error code and save is not performed. At the end of a successful save of the last save set on the client, savepnpc performs any post-processing commands that exist in the /nsr/res/group_name.res file. An optional timeout condition may be set to indicate at which point in the post-processing commands must be run without waiting for the last save set to back up. The Timeout attribute is set in the same /nsr/res/group_name.res file as the pre- and post-processing commands. All of the results from the savepnpc program are logged in the /nsr/res/savepnpc.log file.

The /nsr/res/group_name.res file is automatically created the first time you run a backup group with a client that has the savepnpc command entered in the Backup Command attribute of the Clients resource. The format looks similar to the following:


type: savepnpc;
precmd: /bin/true;
pstcmd: /bin/true, "/bin/sleep 5";
timeout: "12:00pm"; 

You can edit the Precmd field to contain any number of commands, separated by commas, to run prior to the start of the save operation on the client's first save set. You can also edit the Postcmd field to contain any number of commands, separated by commas, to run at the end of the save operation on the client's last save set or the timeout condition indicated in the Timeout field, whichever comes first. All fields in the file must terminate with a semicolon (;).

The command syntax for savepnpc is identical to the syntax described for "save ". If you create a customized script to enter in the client's Backup Command attribute, the following rules apply:

recover

The recover program searches (browses) the client file index for a specified client and recovers files from backup volumes to the specified client. The client file index entries are created when the files are backed up with the save command. When you use the interactive version of the recover program, nwrecover, the client file index is presented in a graphical display format that is similar to a UNIX filesystem.

In the automatic mode (-a option) or save set recover mode (-S option), the files specified on the command line are recovered immediately without browsing the client file index. Use of the save set recover mode (-S option) is restricted to users in the operator group. If you run the recover program without the -S option, and users in the operator group can recover any file.

You can specify one or more path arguments to limit the directories and files to just those you want to recover. If you specify the path argument, the beginning of each path name as it exists in the save set must exactly match one of the paths before it can be recovered. Filename matching using meta characters (for example, *, ?, or [...]) is not allowed. You can use a path that ends with a slash character to force a match to a specific directory.

The following example describes the format and options available for the recover program:


recover [-f] [-n] [-q] [-i {nNyYrR}]

[-d destination] [-c client] [-t date]

[-s server] [dir]
recover [-f] [-n] [-q] [-i {nNyYrR}]

[-d destination] [-c client] [-t date]

[-s server] -a path
recover [-f] [-n] [-q] [-i {nNyYrR}]

[-d destination] [-t date] -s server

-S ssid[/cloneid] [-S ssid[/cloneid]] [path]

nsrmig

The nsrmig program migrates files to the volumes labeled for a Migration pool type. The migrated files are replaced with a stub (a symbolic link) that points to a copy of the file made during premigration with the nsrpmig program. If you access the stub later, the file is automatically recalled to disk from the migration volume by the Backup server or storage node.

The criteria for migration is defined in the Migration resource on the Backup server. Migration is usually an automatic process controlled by the Backup server. The criteria most often employed is last access time. Only regular files are premigrated and, ultimately, migrated.

If you do not specify a path argument, the current directory is migrated. The nsrmig program does not cross mount points, and it does not follow symbolic links.

The following example describes the format and options available for the nsrmig program:


nsrmig [-nvx] [-l percent] -s server] [-t savetime] [-W width] [path]

nsrpmig

The nsrpmig program premigrates files that are identified as candidates for migration, as defined in the Backup server's Migration resource. The premigration process invokes the save program to immediately make a copy of the specified file to a backup volume labeled for migration data. When the file is later migrated, the resident file is replaced with a marker that refers to the premigrated copy on volume. You can only premigrate regular files.

The nsrpmig program does not cross mount points or follow symbolic links. If you mount the path to be saved from a network file server, the nsrpmig program issues a message that instructs the user to run the save program on the remote machine or use the -L option with nsrpmig.

The nsrpmig program examines the directive files (.nsrhsm) encountered in each directory to determine any special instructions to apply when saving files (for example, compression and skip directives). The directive files ordinarily used by Backup for save and recover operations (.nsr) are ignored by the nsrpmig program.

The nsrpmig program is only available for use when an enabler code for the Backup HSM is present on the Backup server.

The following example describes the format and options available for the nsrpmig program:


nsrpmig [-BEiLnpqvx] [-s server] [-N name]

[- f dirfile] [-b pool] [-g group]

[-m masquerade] [-W width] [-C clone-pool]

[-I input-file] path

nsrhsmck

The nsrhsmck program checks and corrects the consistency between the file stubs and the client file index entries for files migrated by HSM. The nsrhsmck program handles four situations:

nsrarchive

The nsrarchive program archives files, including directories or entire filesystems, to the Backup server. You can use the nwadmin or nsrwatch programs to monitor the progress of an archive operation. Only users on the Administrator and Archive Users lists have the required privileges to run the nsrarchive program. Additionally, you can allow or disallow public archives through an option in the NSR (or Server) resource, which enables other clients to recover data archived from a particular client machine.

If you do not specify a path argument, the current directory is archived. The nsrarchive program archives all the files and subdirectories contained in a directory, but does not cross mount points or follow symbolic links. If the paths to be archived are mounted from a network fileserver, the nsrarchive program returns a message that instructs you to run the nsrarchive program on the remote machine or use the -L option.

The .nsr directive files encountered in each directory are read by default. The directive files contain instructions on how specific files should be archived (for example, compression).

Each file in the subdirectory structures specified by the path option is encapsulated in a Backup save stream. This stream of data is sent to a receiving process on the Backup server, which processes the data and adds entries to the client file index for each file in the stream. The data is then directed to long-term storage, either on the server or the designated storage node.

The following example describes the format and options available for the nsrarchive program:


nsrarchive [-BiLnpqvxVy] [-b pool] [-C clone-pool]

[-f filename] [-G remove] [-N name] [-R name]

[-s server] [-T annotation] [-W width] [path...]

nsrretrieve

The nsrretrieve program is used to restore archived save sets from the archive volumes managed by the Backup server or storage node. You do not browse client file index entries for archived save sets as you do for regular save sets; you search for a specific annotation string to identify the archive save set you want to retrieve.

The use of nsrretrieve is restricted to users on the Backup server's Administrators and Archive Users list. If the nsrretrieve program is not run by root or a user defined in the operator group, or the Public Archives attribute of the Server resource is not enabled, only the owner of the archived files can retrieve them.

The following example describes the format and options available for the nsrretrieve program:


nsrretrieve [-f] [-n] [-q] [-i {nNyYrR}] [-d destination] -s server [-
S ssid[/cloneid]]... [-A annotation]...

[path]...

nsrclone

The nsrclone program makes new copies of existing save sets. The operation is automatic when you enable the Clones attribute of a NSR group resource. You can also run nsrclone on a manual basis from the command line.

Although the command line options enable you to specify a volume name or identifier, nsrclone always copies complete save sets, regardless of how many volumes the save set components reside on. The nsrclone program does not copy volumes; instead, it copies the original save sets specified from one volume to a volume assigned to a special pool for clones. If the first destination volume cannot hold all the save sets to be cloned, another volume from the same clone pool is chosen.

If you use the -c and -N options together, nsrclone creates a super-full copy for the given client save set. The super-full copy is a feature that is supported only under HSM. It automatically creates a clone of the most recent complete full backup of the named client and save set, along with any HSM migration save sets referred to by the full backup. Super-full copies should be cloned to a volume from a migration clone pool. If no migration save sets are referenced by the most recent full backup, only the full set is cloned.

The nsrclone program, in cooperation with the nsrmmd daemon, guarantees that each save set has only one clone on a given volume. When you specify a volume name or identifier, the copy of the save sets on that volume are used as the source. When you specify save sets explicitly, those with existing multiple copies are automatically chosen; copies of save sets that exist on volumes in an autochanger or silo are chosen over those that require operator intervention. You can also specify which copy of a save set to use as the source, with the -S option.

The following example describes the format and options available for the nsrclone program:


nsrclone [-v] [-s server] [-b pool]

{-f file | volume-name}
nsrclone [-v] [-s server] [-b pool] -S

{-f file | ssid}
nsrclone [-v] [-s server] [-b pool] -V

{-f file | volumeid}
nsrclone [-v] [-s server] [-b pool]

-c client -N saveset

nsrstage

The nsrstage program is used on a manual basis to migrate existing save sets from one volume to another. The process begins with a clone of the specific save sets to the new volume specified, followed by deletion of the save set entries from the media database, and finally a removal of the save sets from the original source volume, if possible. The media database entries and save sets are not removed if the clone to the new volume does not succeed.

You can migrate save sets onto volumes that belong to any of the media types supported by Backup (for example, save sets on a file volume may be migrated to an optical disk). However, all volumes used as the destination of a nsrstage operation must belong to a Clone pool type. Refer to the nsr_pool(1m) man page for a description of the various pool types.

The nsrstage program does not perform simple volume migration; it migrates complete save sets. You can specify the copy (clone) of a save set to use as the migration source with the -S ssid option.

The following example describes the format and options available for the nsrstage program:


nsrstage [-v] [-s server] [-b pool] -m

[-S {ssid/cloneid}]
nsrstage [-v] [-s server] -C -V volume

scanner

The scanner program directly reads Backup media (such as backup tapes, optical disks, or files) to confirm the contents of a volume, to extract a save set from a volume, or to rebuild the Backup online indexes. You can only run this command as root. You must specify a device, which is usually one of the device names used by the Backup server. If the device is a tape drive, it must be a nonrewinding type.

If you invoke the scanner program without options (or only the -v option), the volume on the specified device is scanned and a table of contents is generated. The table of contents contains information about each save set found on the volume. By default, one line of information is written to standard output for each save set found on the volume. The information provides the client name, save set name, save time, level, size, files, ssid, and flag.

The following example describes the format and options available for the scanner program:


scanner [-Bimnpqv] [-s server] [-S ssid]

[-c client] [-N name] [-f file] [-r record]

[-t type] [-b pool] device [-x command argument-list]