Configure the Backup Service Using staservadm

Use the staservadm utility to configure the STA Backup Service.

Prerequisites

Parameters

The staservadm utility uses the parameters listed in the table below. You can submit as many parameters as you want in each staservadm command line. The utility only updates the parameters you specify. The unspecified parameters remain at their current value.

Some settings (denoted by * in the table) require you to stop and restart the Services Daemon if you want the setting to take effect immediately. Otherwise these changes take effect as soon as the Backup Service wakes from its current sleep interval.

Name Parameter Description Sample Value
Help -h, --help Displays command usage information. NA
Clear Settings -C, --clear Clears all settings and disables the backup service. NA
Query Settings -Q, --query Displays the current Backup service settings. NA
File Transfer -S, --scp | -F, --ftp The file transfer method: SCP or FTP. SCP is recommended. SCP (default)
Full Backup Time* -T, --time The time of day full backups are performed. Format is hh:mm, using 24-hour time. The dump is performed automatically every 24 hours at approximately this time. The actual time is within one incremental backup interval after this time. 23:30

00:00 (default)

Sleep Interval* -i, --int The number of seconds between incremental backups. Valid entries: integers 1 to 86399. 1800
(=30 minutes)

300 (default)

Backup Hostname -s, --server The hostname or IP address of the server which the STA Backup service copies the backup files to. You can specify an IPv4 or IPv6 address, or a fully qualified DNS host name. stabackup
Backup Username -u, --usr System username that writes the database backup files to the target directory. This must be a user on the backup server that has write privileges to the target directory. If you specify a username, you must also specify a password. root
Backup Password -p, --pwd The password for the backup username.

If you enter just -p on the command line, the utility will prompt for the password, which is hidden when you type it.

NA
Backup Directory -d, --dir Directory on the backup server where the backup files will be copied. This directory must already exist on the server. /dbbackup
Database Username -U, --dbusr The MySQL database administrator account created during STA installation. stadba

blank (default)

Database Password -P, --dbpwd Password for the database root username. blank (default)

Display Current STA Backup Settings

Display the current settings to determine if the Backup service is configured.

  1. Open a terminal session on the STA server, and log in as the Oracle user.

  2. Display the current STA Backup service settings:

    $ staservadm -Q
    

    In this example, the STA Backup service is enabled and configured.

     Current STA Backup Service Settings:
       Configured            [yes]
       File Transfer      –S [SCP]
       Full Backup        –T [23:00]
       Sleep Interval     –i [350 sec]
       Backup Hostname    –s [stabackup]
       Backup Username    –u [root]
       Backup Password    –p [*******]
       Backup Directory   –d [/dbbackup]
       Database Username  –U [stadba]
       Database Password  –P [*********]
    

Enable the STA Backup Service

Enable the Backup Service to perform automatic backups of the STA database according to the defined settings. The Backup Service is disabled by default.

  1. Open a terminal session on the STA server, and log in as the Oracle user.

  2. To enable the service, all parameters must be defined. For parameters with default values, you can retain the defaults or define new values. See Configure the Backup Service Using staservadm for a list of parameters.

    Define the required parameters in one or more commands. For example:

    $ staservadm -s stabackup -d /dbbackup -u root -p -U stadba -P
    
  3. The utility runs the first full backup at the full backup time and incremental backups periodically after that. You to not need to stop and restart the STA services daemon.

  4. If the utility fails with:

    Error: java.util.prefs.BackingStoreException: Couldn't get file lock.
    

    See ISSUE: Backup Service or Resource Monitor Fails.

Disable the STA Backup Service

Disable the STA Backup service by clearing all settings.

  1. Open a terminal session on the STA server, and log in as the Oracle user.

  2. Clear all preference settings:

    $ ./staservadm –C
    
     Current STA Backup Service Settings:
       Configured            [no]
       File Transfer      –S [SCP]
       Full Backup        –T [00:00]
       Sleep Interval     –i [300 sec]
       Backup Hostname    –s []
       Backup Username    –u []
       Backup Password    –p []
       Backup Directory   –d []
       Database Username  –U []
       Database Password  –P []
    
  3. The service is disabled immediately. You do not need to stop and restart the STA services daemon.

  4. If the utility fails with:

    Error: java.util.prefs.BackingStoreException: Couldn't get file lock.
    

    See ISSUE: Backup Service or Resource Monitor Fails.

Define the Time of Day for Full Backups

The Backup service performs a full backup at the time defined in the settings. The time is based on the system time on the STA server.

  1. Open a terminal session on the STA server, and log in as the Oracle user.

  2. Use the -T command to define the time to perform backups. For example:

    $ staservadm -T 23:30
    
  3. If you want the new settings to take effect immediately, you must stop and restart the STA services daemon. See Services Daemon - Stop, Restart, or Show Status.

    Note:

    If a full backup has already occurred earlier in the day, the service won't create a full backup today at the new time. See below.

Why didn't the backup run today after I changed the time settings?

The Backup service only runs a single full backup per day. Therefore, if a full backup occurred earlier in the day, the service won't run a second backup after you change the time.

For example, the previous settings were 1:00 (1 a.m.) and you change the settings to 23:00 (11 p.m.). If you changed the settings after the 1 a.m. backup has occurred, the service will not perform a full backup at 11 p.m. because a backup has already occurred today. The service will start performing backups at 11 p.m. the following day.

Define the Incremental Backup Interval

The sleep interval defines the amount of time in seconds between incremental backups. Define a time that meets your site's backup requirements.

  1. Open a terminal session on the STA server, and log in as the Oracle user.

  2. Use the -i command to define the interval time in seconds. Valid values are 1 to 86399. The default is 300.

    For example, to take an incremental backup every 30 minutes:

    $ staservadm -i 1800
    
  3. If you want the new settings to take effect immediately, you must stop and restart the STA services daemon. See Services Daemon - Stop, Restart, or Show Status.

See Also: