12.1 Parameters for the Backup and Restore Utility Script

The following table lists the various command line parameters that you can use with the cgbackup_util.sh script:

Table 12-1 Backup and Restore Script Parameters

Parameters

Description

-m backup

Backs up the specified data.

-m restore

Restores the specified data. The restore mode of the script is interactive and allows you to specify the data to restore from the backup file.

The restore parameter can be used in the following scenarios:

  • System Failure: In the event of a system failure, you must first reinstall Change Guardian and then use the cgbackup_util.sh script with the restore parameter to restore the most recent data that backed up.

  • Data Loss: In the event of data loss, use the cgbackup_util.sh script with the restore parameter to restore the most recent data that you had backed up.

    You must restart the Change Guardian server after you restore any data because the script might make several modifications to the database.

-m info

Displays information for the specified backup file.

-m simple_event_backup

Backs up events located in a specified directory.

-m simple_event_restore

Restores events into a specified directory.

-c

Backs up the configuration data, Policy Editor settings, policies that are created and assigned, alert configurations, event dashboard configurations.

-e

Backs up the event data. All event partitions are backed up except the current online partition. If the backup is being performed with the Change Guardian server shut down, the current online partition is also included in the backup. It backs up event data from all the directories and subdirectories.

-dN

Backs up the event data for the specified number of days. The -dN option backs up the primary storage event data stored for the last N days. Based on the current data retention policy settings, many days of events might be stored on the system. Backing up all of the event data might not always be necessary and might not be desirable. This option allows you to specify how many days to include when backing up the event data. For example, -d7 includes only the event data from the last week in the backup. -d0 just includes the data for the current day. -d1 includes the data from the current day and previous day. -d2 includes the data from the current day and two days ago.

Online backups (that is, backups performed while the system is running) only back up the closed event partitions, which means partitions one day old or older. For online backups, a value of -d1 is the appropriate specification for the number of days.

-u

Specifies the user name to use when backing up the event associations data. If the user name is not specified, admin is the default value.

This parameter is required only when backing up the event associations data.

-p

Specifies the user password when backing up the event associations data.

This parameter is required only when backing up the event associations data.

-x

Specifies a file name that contains the user password when backing up the event associations data. This is an alternative to the -p parameter.

This parameter is required only when backing up the event associations data.

-f

Specifies the location and name of the backup file.

-l

Includes the log files in the backup. By default, the log files are not backed up unless you specify this option.

-r

Includes the runtime data in the backup. To back up runtime data, you must shut down the Change Guardian server because data is dynamic. This parameter must be used in combination with the -s option (described below). If -s is not specified, this parameter is ignored.

-A

Backs up alerts and the events that triggered the alert.

-s

Shuts down the Change Guardian server before performing the backup. Shutting down the server is necessary to back up certain dynamic data, such as the runtime data and current primary storage partitions. By default, the server does not shut down before the backup. If you use this option, the server restarts automatically after the backup is complete.

-w

Backs up the raw event data.

-z

Specifies the location of the event data directory, such as where the event data is collected during a simple_event_backup and where the event data is placed during a simple_event_restore. Only available with the simple_event_backup and simple_event_restore options.