Backup3G/User Guide/Appendix D - Defining Backup Methods
This page was last modified 10:52, 6 March 2008.From Documentation
Revision as of 08:20, 21 April 2006 Moff (Talk | contribs) (→How to Define Backup Methods) ← Previous diff |
Current revision Moff (Talk | contribs) (Backup3G 5.1/User Guide/Appendix D - Defining Backup Methods moved to Backup3G/User Guide/Appendix D - Defining Backup Methods) |
||
Line 2: | Line 2: | ||
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. | 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. | ||
+ | __FORCETOC__ | ||
<br> | <br> | ||
Line 9: | Line 10: | ||
backup method. | backup method. | ||
- | Backup3G maintains several variables that you can use in a backup command — see [[Shell Variables in Backup Commands]]. | + | Backup3G maintains several variables that you can use in a backup command — see [[#Shell Variables in Backup Commands|Shell Variables in Backup Commands]]. |
Here is the definition of one common method, ‘full cpio’. | Here is the definition of one common method, ‘full cpio’. | ||
Line 49: | Line 50: | ||
== Shell Variables in Backup Commands == | == 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>. | + | 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: <tt>$<variablename></tt>. |
Line 57: | Line 58: | ||
- | {| border="1" cellpadding="3" cellspacing="0" | + | {| border="1" cellpadding="6" cellspacing="0" |
|+Table 11 — Variables available to be used in backup commands | |+Table 11 — Variables available to be used in backup commands | ||
|- | |- | ||
Line 63: | Line 64: | ||
!Description | !Description | ||
|- | |- | ||
- | |maxstatus | + | |<tt>maxstatus </tt> |
|The highest exit status of the backup steps run so far. | |The highest exit status of the backup steps run so far. | ||
|- | |- | ||
- | |status | + | |<tt>status </tt> |
|The exit status from the previous backup step. | |The exit status from the previous backup step. | ||
|- | |- | ||
- | |Blocksize | + | |<tt>Blocksize </tt> |
|The block size of the backup volume. | |The block size of the backup volume. | ||
|- | |- | ||
- | |Capacity | + | |<tt>Capacity </tt> |
|The data storage capacity of the backup volume. | |The data storage capacity of the backup volume. | ||
|- | |- | ||
- | |Comments | + | |<tt>Comments </tt> |
|Comments from the backup item relating to current backup step. | |Comments from the backup item relating to current backup step. | ||
|- | |- | ||
- | |Days | + | |<tt>Days </tt> |
|The number of days to retain the backup volume. | |The number of days to retain the backup volume. | ||
|- | |- | ||
- | |Density | + | |<tt>Density </tt> |
|The density of the backup volume. | |The density of the backup volume. | ||
|- | |- | ||
- | |Device | + | |<tt>Device </tt> |
|The rewind-on-close device file for the backup drive. | |The rewind-on-close device file for the backup drive. | ||
|- | |- | ||
- | |Device_nr | + | |<tt>Device_nr </tt> |
|The ‘no rewind-on-close’ device file for the backup drive. | |The ‘no rewind-on-close’ device file for the backup drive. | ||
|- | |- | ||
- | |Directory | + | |<tt>Directory </tt> |
|The directory which is to be backed up. | |The directory which is to be backed up. | ||
|- | |- | ||
- | |Drive | + | |<tt>Drive </tt> |
|The logical backup drive name. | |The logical backup drive name. | ||
|- | |- | ||
- | |Drivehost | + | |<tt>Drivehost </tt> |
|The host to which the backup drive is connected. | |The host to which the backup drive is connected. | ||
|- | |- | ||
- | |Drivename | + | |<tt>Drivename </tt> |
|The physical backup drive name. | |The physical backup drive name. | ||
|- | |- | ||
- | |File | + | |<tt>File </tt> |
|The file number on volume being written or about to be written. | |The file number on volume being written or about to be written. | ||
|- | |- | ||
- | |Format | + | |<tt>Format </tt> |
|The format in which the backup is written. | |The format in which the backup is written. | ||
|- | |- | ||
- | |Host | + | |<tt>Host </tt> |
|The host on which the data lives (the file host). | |The host on which the data lives (the file host). | ||
|- | |- | ||
- | |Indexfile | + | |<tt>Indexfile </tt> |
|The file name for the online index. NULL means ‘do not generate an index’. | |The file name for the online index. NULL means ‘do not generate an index’. | ||
|- | |- | ||
- | |Item | + | |<tt>Item </tt> |
|The backup item number referred to by the current backup step. | |The backup item number referred to by the current backup step. | ||
|- | |- | ||
- | |Job | + | |<tt>Job </tt> |
|Backup job name. | |Backup job name. | ||
|- | |- | ||
- | |Length | + | |<tt>Length </tt> |
|The length of the backup volume. | |The length of the backup volume. | ||
|- | |- | ||
- | |Method | + | |<tt>Method </tt> |
|The backup method used by the backup item. | |The backup method used by the backup item. | ||
|- | |- | ||
- | |Mode | + | |<tt>Mode </tt> |
|The backup job mode (scheduled, automatic or at-request). | |The backup job mode (scheduled, automatic or at-request). | ||
|- | |- | ||
- | |Number | + | |<tt>Number </tt> |
|The media number of the volume currently being written to. | |The media number of the volume currently being written to. | ||
|- | |- | ||
- | |Part_size | + | |<tt>Part_size </tt> |
|The maximum size of each part in a multi-part backup. | |The maximum size of each part in a multi-part backup. | ||
|- | |- | ||
- | |Pool | + | |<tt>Pool </tt> |
|Group of logical drives | |Group of logical drives | ||
|- | |- | ||
- | |Queuename | + | |<tt>Queuename </tt> |
|Name of the physical drive or drive pool to which the job is queued. Once the job starts running, Queuename = Drivename | |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 | + | |<tt>Retention </tt> |
+ | |The retention period for the backup media. | ||
+ | |- | ||
+ | |<tt>Seq </tt> | ||
|The sequence number of this volume in the media set produced by this job. | |The sequence number of this volume in the media set produced by this job. | ||
|- | |- | ||
- | |Step | + | |<tt>Step </tt> |
|Backup step number. | |Backup step number. | ||
|- | |- | ||
- | |Time | + | |<tt>Time </tt> |
|The time of day that the backup was scheduled to run. | |The time of day that the backup was scheduled to run. | ||
|- | |- | ||
- | |Type | + | |<tt>Type </tt> |
|The backup media type. | |The backup media type. | ||
|} | |} | ||
+ | |||
+ | <br> |
Current revision
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.
Contents |
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
- Select backup3G configuration > Maintain tables
- Select the ‘Backup Method’ table, then select Table > Maintain to see the backup methods that have already been defined.
- 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’.
- 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.
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. |