Use the hasnap command to take snapshots of VCS configuration files on each node in the cluster. You can also restore the configuration from a snapshot.
The command includes the following options; each option is described in detail in the following sections:
Note
With the exception of the -include
, -exclude
, and the -delete
options, all options can be combined with the -f
option. This option indicates that all files be backed up to or restored from the specified single file instead of a local, predefined directory on each node. This option is useful when you want to store the configuration data to an alternate location that is periodically backed up using backup software like Veritas Net Backup.
The hasnap -backup
command backs up files in a snapshot format. A snapshot is a collection of VCS configuration files backed up at a particular point in time, typically before making changes to the existing configuration. A snapshot also contains information such as the snapshot name, description, creation time, and file permissions.
The command backs up a predefined list of VCS configuration files as well as a user-defined list. The predefined list includes all the *.cf files, custom agents, LLT and GAB configuration files, triggers, custom heartbeats, and action scripts. See the -include
and -exclude
commands to construct a user-defined list.
To back up VCS configuration files
hasnap -backup [-f
filename] [-n] [-m
description]
Use the -n
option to run the command in the non-interactive mode.
Use the -m
option to specifies a description of the snapshot.
The following command creates a backup of the configuration in the non-interactive mode and adds Test Backup as the backup description.
hasnap -backup -n -m "Test Backup"
The following command creates a backup of the configuration files and saves it as /tmp/backup-2-2-2003 on the node where the command was run.
hasnap -backup -f /tmp/backup-2-2-2003
The hasnap -restore
command restores configuration files from a previously created snapshot.
To restore VCS configuration files
hasnap -restore [-f
filename] [-n] [-s
snapid]
If you do not specify a snapshot ID, the command lists the snapshots that are available for restoration.
The following command restores the snapshot vcs-20030101-22232 in the non-interactive mode.
hasnap -restore -n -s vcs-20030101-22232
The following command restores the snapshot stored in the file /tmp/backup-2-2-2003.
hasnap -restore -f /tmp/backup-2-2-2003
Use the hasnap -display
command to view details of previously created snapshots.
To view snapshots of configuration files
hasnap -display [-f
filename] [-list|-s
snapid] [-m] [-l] [-t]
Specifies the snapshot ID.D
isplays snapshot description. Lists files in the snapshot Displays the snapshot timestamp
If no options are specified, the command displays all information about the latest snapshot.
The following command lists all snapshots.
The following command displays the description and the time of creation of the specified snapshot.
hasnap -display -s vcs-20030101-2232 -m -t
The following command displays the description, the timestamp, and the list of all files in the snapshot file /tmp/backup-2-2-2003
hasnap -display -f /tmp/backup-2-2-2003
Use the hasnap -sdiff
command to display files that were changed on the local system after a specific snapshot was created.
To view files that changed after a snapshot
hasnap -sdiff [-f
filename] [-s
snapid] [-sys
hostname]
If you do not specify any options, the command uses the latest snapshot to compare the files on each node in the cluster.
The following command displays the differences between the current configuration and the snapshot vcs-20030101-22232.
hasnap -sdiff -s vcs-20030101-22232
The following command displays the difference between the configuration on system host1 and the snaphot stored in the file /tmp/backup-2-2-2003.
hasnap -sdiff -f /tmp/backup-2-2-2003 -sys host1
Use the hasnap -fdiff
to displays differences between a file on the cluster and its copy stored in a previously created snapshot.
To compare a file with its snapshot copy
hasnap -fdiff [-f
filename] [-s
snapid] [-sys
hostname] file
If you do not specify any options, the command uses the latest snapshot to compare the file on each node in the cluster.
The following command displays the differences between the files /etc/VRTSvcs/conf/config/main.cf on host1 and its version in the last snapshot.
hasnap -fdiff -sys host1 /etc/VRTSvcs/conf/config/main.cf
The following command displays the differences between the files /var/llttab on each node in the cluster and the version stored in the snapshot contained in the file /var/backup-2-2-2003.
hasnap -fdiff -f /tmp/backup-2-2-2003 /etc/llttab
Use the hasnap -export
command to export a snapshot from the local, predefined directory on each node in the cluster to a specified file. This option is useful when you want to store a previously created snapshot to an alternate location that is periodically backed up using backup software like Veritas NetBackup.
hasnap -export -f
filename [-s
snapid]
If you do not specify a snapshot ID, the command exports the latest snapshot to the specified file.
The following command exports data from snapshot vcs-20030101-22232 from each node in the cluster to the file /tmp/backup-2-2-2003 on the current node.
hasnap -export -f /tmp/backup-2-2-2003 -s vcs-20030101-22232
Use the hasnap -include
command to configures the list of files or directories to be included in new snapshots. This list is in addition to the files included by the -backup
command.
See Backing up configuration files.
To add or remove files for a snapshots
hasnap -include -add|-del|-list [-sys
hostname]
Adds the specified files or directories to the include file list.
Removes the specified files or directories from the include file list.
The following command displays the list of files or directories to be included in new snapshots on each node of the cluster.
The following command adds the file /opt/VRTSweb/conf/vrtsweb.xml to the include list on host1, which results in this file being included in the snapshot the next time the hasnap -backup
command is run.
hasnap -include -add /opt/VRTSweb/conf/vrtsweb.xml
The following command removes the file /opt/VRTSweb/conf/vrtsweb.xml from the include list on host1.
hasnap -include -del -sys host1 /opt/VRTSweb/conf/vrtsweb.xml
Use the hasnap -exclude
command to configure the list of files or directories that should not be included in new snapshots.
To exclude files from snapshots
hasnap -exclude -add|-del|-list [-sys
hostname]
Adds the specified files or directories to the exclude file list.
Removes the specified files or directories from the exclude file list.
The following command displays the exclude file list on each node in the cluster.
The following command adds the file /etc/VRTSvcs/conf/config/temp.cf to the exclude file list on host1, which results in this file being excluded from the snapshot the next time the hasnap -backup
command is run.
hasnap -exclude -add -sys host1 /etc/VRTSvcs/conf/config/temp.cf
The following command removes the file /etc/VRTSvcs/conf/config/temp.cf from the exclude list on host1.
hasnap -exclude -del -sys host1 /etc/VRTSvcs/conf/config/temp.cf
Use the hasnap -delete
command to delete snapshots from the predefined local directory on each node.
If you do not specify the snapshot ID, the command lists the snapshots that can be deleted.
The following command deletes snapshot vcs-20030101-22232 from the cluster.