FS
Documentation

Backup3G/User Guide/Appendix D - Defining Backup Methods

From Documentation

Jump to: navigation, search

If you wish to keep using your own backup software or a third-party product, you can define the commands as a new backup method.

This appendix describes how to define a new backup method, and lists the variables maintained by backup3G that you can use to customize how a backup method works.


How to Define Backup Methods

Each step in a backup job names a data object and the method that will be used to back it up. A method can also implement a related step that doesn’t write data. Any command or script that could be run from the UNIX prompt can be used in a backup method.

Backup3G maintains several variables that you can use in a backup command — see Shell Variables in Backup Commands.

Here is the definition of one common method, ‘full cpio’.

Format
cpio
Backup Command
FScpio -f -I \"$Indexfile\" $Directory
Description
Full backup of directory using cpio


FScpio is a driver (supplied with backup3G) which writes the data in cpio format. The flags -f and -I mean that a full backup is to be done and an online index will be created. ‘full cpio’ is a convenient and descriptive way to refer to this command for use with many different backup jobs. If the command format or site requirements ever change, only the method needs to be changed in one place. Every backup job that uses that method will automatically be updated.



Note
The FS backup drivers provide a consistent front-end to the underlying archiving commands. They do not write data in a proprietary format. For example, FScpio uses the standard cpio command and writes data in standard cpio format.


To define a backup method

  1. Select backup3G configuration > Maintain tables
  2. Select the ‘Backup Method’ table, then select Table > Maintain to see the backup methods that have already been defined.
  3. Select Maintain > Add, and enter the following fields:
    Backup method
    Enter a descriptive name. Include some attributes of the method,such as the name of the command or format, whether it will do full or incremental backups, and whether it supports multi-part backups. Example: incr cpio - MP
    Description
    Ideally this is an expansion of the method name. This description will help other users when choosing a backup method from the list of available methods.
    Format
    Select a backup format. This determines the recovery method. Leave Format blank if you are defining a non-backup method (a method that doesn’t write data).
    Backup command
    Enter the command that you want this method to execute.
    Note
    Any double-quotes (") in the backup command must be protected by a backslash character, that is \". If this is not done the command will be incorrectly parsed by the shell.
    If you left the Format field blank, the next four fields are set to default values. If you selected a backup format, the information in these three fields helps backup3G to process the backup command.
    Multipart support?
    Select ‘yes’ if your method supports multipart backups. (See $APPL_HOME/bin/FSmcpio for an example of how to implement support for multi-part backups and online indexes.)
    Uses STDOUT?
    Select ‘yes’ if your backup command writes to standard output(stdout). Select ‘no’ if it writes directly to the device. If you select ‘yes’, backup3G uses devio(1) to read stdout and write the data to the device, using the block size specified for this media type in the media table.
    Index support?
    Select ‘yes’ if your method supports online indexes. Generally this will be ‘yes’ if you use one of the standard backup drivers (FScpio, FSfilesys, FSdump or FStar), otherwise ‘no’.
    Remote support?
    Select ‘yes’ if your method supports backup and recovery on a remote host. This doesn’t mean that all backups using your method must be run remotely. It just tells backup3G to give users the option when defining a backup.
    If Uses STDOUT? is ‘yes’, the method automatically supports remote backup.
    Run on host
    Governs on which host the method will run. For remote backups, select ‘drive-host’ if the method only accesses the backup drive without writing data, otherwise use ‘file-host’.
  4. Press Accept to save the changes and return to the methods table.


Shell Variables in Backup Commands

Table 11 lists the variables maintained by backup3G that you can refer to in your backup command. All the variables that are data amounts (Blocksize, Capacity, and Part_size) are in kilobytes (KB). The syntax for referring to variables is similar to shell syntax: $<variablename>.



Note
You can use the fields status and maxstatus for dependency tests.


Table 11 — Variables available to be used in backup commands
Variable Description
maxstatus The highest exit status of the backup steps run so far.
status The exit status from the previous backup step.
Blocksize The block size of the backup volume.
Capacity The data storage capacity of the backup volume.
Comments Comments from the backup item relating to current backup step.
Days The number of days to retain the backup volume.
Density The density of the backup volume.
Device The rewind-on-close device file for the backup drive.
Device_nr The ‘no rewind-on-close’ device file for the backup drive.
Directory The directory which is to be backed up.
Drive The logical backup drive name.
Drivehost The host to which the backup drive is connected.
Drivename The physical backup drive name.
File The file number on volume being written or about to be written.
Format The format in which the backup is written.
Host The host on which the data lives (the file host).
Indexfile The file name for the online index. NULL means ‘do not generate an index’.
Item The backup item number referred to by the current backup step.
Job Backup job name.
Length The length of the backup volume.
Method The backup method used by the backup item.
Mode The backup job mode (scheduled, automatic or at-request).
Number The media number of the volume currently being written to.
Part_size The maximum size of each part in a multi-part backup.
Pool Group of logical drives
Queuename Name of the physical drive or drive pool to which the job is queued. Once the job starts running, Queuename = Drivename

Retention The retention period for the backup media.

Seq The sequence number of this volume in the media set produced by this job.
Step Backup step number.
Time The time of day that the backup was scheduled to run.
Type The backup media type.