Backup3G/User Guide/Recovery
From Documentation
Revision as of 05:55, 18 April 2006 Daniels (Talk | contribs) ← Previous diff |
Revision as of 15:45, 18 April 2006 Moff (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
- | The real test of a backup system is its ability to quickly and easily restore files. This | + | The real test of a backup system is its ability to quickly and easily restore files. This involves finding the files, ensuring that they are the correct versions, allowing flexible restoration—to any directory on any host, and logging all movements of files. |
- | involves finding the files, ensuring that they are the correct versions, allowing flexible | + | |
- | restoration—to any directory on any host, and logging all movements of files. | + | This section introduces the key concepts in efficient recovery, concentrating on how to ensure that you can find the files that you want to recover: |
- | This chapter introduces the key concepts in efficient recovery, concentrating on | + | *searching online indexes and the media contents |
- | how to ensure that you can find the files that you want to recover: | + | *multipart recovery |
- | • searching online indexes and the media contents | + | *restricting which hosts and directories particular users can recover to. |
- | • multipart recovery | + | |
- | • restricting which hosts and directories particular users can recover to. | + | <br> |
- | 46 Information on Recovery | + | == Searching Backup Media == |
- | Searching Backup Media | + | |
- | backup3G has two methods of pattern matching for searching media contents and | + | Backup3G has two methods of pattern matching for searching media contents and |
online indexes. By default it treats search expressions as shell file patterns, using the | online indexes. By default it treats search expressions as shell file patterns, using the | ||
Bourne shell file name metacharacters. For more complex searches you can choose | Bourne shell file name metacharacters. For more complex searches you can choose | ||
to use full regular expressions. | to use full regular expressions. | ||
- | File patterns | + | |
- | backup3G attempts to match the full search string against the list of file names in | + | |
+ | '''File patterns''' | ||
+ | |||
+ | Backup3G attempts to match the full search string against the list of file names in | ||
the index or media contents table. The following expressions have special meanings | the index or media contents table. The following expressions have special meanings | ||
in the search string: | in the search string: | ||
- | Here are some examples of using file patterns to match base directories: | + | |
Table 3 — Searching using file patterns | Table 3 — Searching using file patterns | ||
* match any number of characters, including null | * match any number of characters, including null | ||
Line 23: | Line 26: | ||
[…] match any character in this set or range | […] match any character in this set or range | ||
[!…] match any character not in this set or range | [!…] match any character not in this set or range | ||
+ | |||
+ | Here are some examples of using file patterns to match base directories: | ||
Pattern Matches Description | Pattern Matches Description | ||
/local/* /local/bin | /local/* /local/bin | ||
Line 40: | Line 45: | ||
Base directories starting with a or b that are subdirectories | Base directories starting with a or b that are subdirectories | ||
of the l directories in the previous example | of the l directories in the previous example | ||
- | Information on Recovery 47 | + | |
- | Regular expressions | + | |
- | backup3G uses similar rules to those of awk(1) to process regular expressions. In | + | '''Regular expressions''' |
+ | |||
+ | Backup3G uses similar rules to those of awk(1) to process regular expressions. In | ||
fact awk itself is used to handle many pattern searches, for example when you specify | fact awk itself is used to handle many pattern searches, for example when you specify | ||
a partial file name to search online indexes. | a partial file name to search online indexes. | ||
- | Note backup3G uses its own regexp library instead of the system’s | + | |
+ | '''Note -''' backup3G uses its own regexp library instead of the system’s | ||
regexp(3) library, as different versions of UNIX handle regular | regexp(3) library, as different versions of UNIX handle regular | ||
expressions in different ways. | expressions in different ways. | ||
+ | |||
Generally, any string matching regular expression (RE) will work the same in a | Generally, any string matching regular expression (RE) will work the same in a | ||
backup3G pattern search as it would in an awk statement. For example: | backup3G pattern search as it would in an awk statement. For example: | ||
- | Note that the \{…\} construct is not supported. See the egrep(1) man page for | + | |
- | more details. | + | |
. match any character | . match any character | ||
[s] match any character in this set or range | [s] match any character in this set or range | ||
Line 61: | Line 69: | ||
| alternation – match either RE | | alternation – match either RE | ||
(…) group the enclosed characters into a RE | (…) group the enclosed characters into a RE | ||
- | 48 Information on Recovery | + | |
+ | Note that the \{…\} construct is not supported. See the egrep(1) man page for | ||
+ | more details. | ||
+ | |||
Table 4 lists some examples of regular expressions used to match base directories: | Table 4 lists some examples of regular expressions used to match base directories: | ||
+ | |||
Table 4 — Searching using regular expressions | Table 4 — Searching using regular expressions | ||
+ | |||
The file name pattern can either be relative to the base directory or include the base | The file name pattern can either be relative to the base directory or include the base | ||
directory name. For example, if the base directory is /usr, and you are searching | directory name. For example, if the base directory is /usr, and you are searching | ||
for files under /usr/home/jdoe, enter /usr for Base directory/pattern. | for files under /usr/home/jdoe, enter /usr for Base directory/pattern. | ||
Any of the following patterns will work for Filename/pattern: | Any of the following patterns will work for Filename/pattern: | ||
+ | |||
The base directory is optional. Its purpose is to limit the search to a subset of all the | The base directory is optional. Its purpose is to limit the search to a subset of all the | ||
backups on the system. It is possible, though not recommended, to enter only a file | backups on the system. It is possible, though not recommended, to enter only a file | ||
Line 97: | Line 111: | ||
jdoe | jdoe | ||
/usr.*j includes base directory | /usr.*j includes base directory | ||
- | Information on Recovery 49 | + | |
name and leave Base directory/pattern blank. In this case every online | name and leave Base directory/pattern blank. In this case every online | ||
index will be searched. This may be very slow. | index will be searched. This may be very slow. | ||
- | Note Some backup3G prompt screens, such as ‘Search media indexes’ | + | |
+ | '''Note -''' Some backup3G prompt screens, such as ‘Search media indexes’ | ||
(Recover > Search > Files), let you enter both a base | (Recover > Search > Files), let you enter both a base | ||
directory and a file name pattern. backup3G first selects the backups | directory and a file name pattern. backup3G first selects the backups | ||
Line 106: | Line 121: | ||
backups has an index, then searches the indexed backups for files | backups has an index, then searches the indexed backups for files | ||
matching the file name pattern. | matching the file name pattern. | ||
+ | |||
If you’re not sure of a file name, a good rule-of-thumb is to start with a fairly broad | If you’re not sure of a file name, a good rule-of-thumb is to start with a fairly broad | ||
pattern search, then use the Search key to find the file in the resulting list. Another | pattern search, then use the Search key to find the file in the resulting list. Another | ||
useful rule is to use the start and end date fields to limit the search even further. | useful rule is to use the start and end date fields to limit the search even further. | ||
+ | |||
Again, remember that broad searches can be very slow to process, depending on the | Again, remember that broad searches can be very slow to process, depending on the | ||
number of indexes to be searched. On some systems a search may fail if the number | number of indexes to be searched. On some systems a search may fail if the number | ||
of indexes is very large. | of indexes is very large. | ||
+ | |||
See To Recover Using Search on page 110 for step by step instructions. | See To Recover Using Search on page 110 for step by step instructions. | ||
- | 50 Information on Recovery | + | |
- | Multi-part Recovery | + | <br> |
+ | == Multi-part Recovery == | ||
+ | |||
When you do a full recovery of files from a multi-part backup step, the recovery job | When you do a full recovery of files from a multi-part backup step, the recovery job | ||
scans all the parts. When you recover selected files, backup3G displays a list of all | scans all the parts. When you recover selected files, backup3G displays a list of all | ||
Line 120: | Line 140: | ||
backup3G determines which parts must be read to recover the files you have | backup3G determines which parts must be read to recover the files you have | ||
requested, and which parts can be skipped. | requested, and which parts can be skipped. | ||
+ | |||
If you enter the names of the files to be recovered, the recovery job will still scan the | If you enter the names of the files to be recovered, the recovery job will still scan the | ||
index to work out which parts to read. If the backup is not indexed, all parts will be | index to work out which parts to read. If the backup is not indexed, all parts will be | ||
read. | read. | ||
+ | |||
Loading of new volumes is handled in the same way as for the backup. If the tape is | Loading of new volumes is handled in the same way as for the backup. If the tape is | ||
in a stacker or jukebox it is loaded automatically, otherwise a ‘change media’ request | in a stacker or jukebox it is loaded automatically, otherwise a ‘change media’ request | ||
is made to the operator via the Backup Monitor. | is made to the operator via the Backup Monitor. | ||
- | Note Multi-part recovery only works with backups created under backup3G | + | |
+ | '''Note -''' Multi-part recovery only works with backups created under backup3G | ||
or under COS/Manager 2.7. For old (pre-2.7) backups each part must | or under COS/Manager 2.7. For old (pre-2.7) backups each part must | ||
be recovered individually. | be recovered individually. | ||
- | Multi-step recovery | + | |
- | backup3G supports multi-step recovery. Selected steps from the multi-step backup | + | |
+ | '''Multi-step recovery''' | ||
+ | |||
+ | Backup3G supports multi-step recovery. Selected steps from the multi-step backup | ||
can be recovered to the original location or to a new location. | can be recovered to the original location or to a new location. | ||
- | Information on Recovery 51 | + | |
- | Restricting Recovery Destinations by Role | + | <br> |
+ | == Restricting Recovery Destinations by Role == | ||
+ | |||
You may wish to restrict which target directories particular users can recover to. The | You may wish to restrict which target directories particular users can recover to. The | ||
ability to recover files is controlled by the ‘Recover by Roles’ table and by two capabilities: | ability to recover files is controlled by the ‘Recover by Roles’ table and by two capabilities: | ||
recover and recoverALL. | recover and recoverALL. | ||
+ | |||
Users with the recoverALL capability can recover files to any directory on any | Users with the recoverALL capability can recover files to any directory on any | ||
remote backup3G host. Users with the recover capability can recover files subject | remote backup3G host. Users with the recover capability can recover files subject | ||
to restrictions. | to restrictions. | ||
+ | |||
The ‘Recovery by Roles’ table (backup3G configuration > Maintain | The ‘Recovery by Roles’ table (backup3G configuration > Maintain | ||
tables) lists the recovery restrictions for various roles. This is used to restrict | tables) lists the recovery restrictions for various roles. This is used to restrict | ||
which directories and hosts particular classes of user can recover files to. | which directories and hosts particular classes of user can recover files to. | ||
+ | |||
Figure 8 — Sample set of recovery restrictions | Figure 8 — Sample set of recovery restrictions | ||
+ | |||
For example, in Figure 8, users with the Operator role can recover to any directory | For example, in Figure 8, users with the Operator role can recover to any directory | ||
on host morticia, /tmp and /local/ops on host mama, and /tmp on any other | on host morticia, /tmp and /local/ops on host mama, and /tmp on any other | ||
host. Users with the Admin role can recover to /tmp, /var, /opt, /users, and | host. Users with the Admin role can recover to /tmp, /var, /opt, /users, and | ||
/local on host mama, and /tmp, /users, and /local on any other host. | /local on host mama, and /tmp, /users, and /local on any other host. | ||
- | backup3G is installed with these defaults: | + | |
- | • the Manager role has recoverALL capability | + | Backup3G is installed with these defaults: |
- | • the Admin role has recover capability | + | *the Manager role has recoverALL capability |
- | • there are no predefined restrictions. | + | *the Admin role has recover capability |
- | Note Restrictions are inherited. A user with both the Admin and the | + | *there are no predefined restrictions. |
+ | |||
+ | '''Note -''' Restrictions are inherited. A user with both the Admin and the | ||
Operator role inherits the restrictions of both roles. | Operator role inherits the restrictions of both roles. |
Revision as of 15:45, 18 April 2006
The real test of a backup system is its ability to quickly and easily restore files. This involves finding the files, ensuring that they are the correct versions, allowing flexible restoration—to any directory on any host, and logging all movements of files.
This section introduces the key concepts in efficient recovery, concentrating on how to ensure that you can find the files that you want to recover:
- searching online indexes and the media contents
- multipart recovery
- restricting which hosts and directories particular users can recover to.
Searching Backup Media
Backup3G has two methods of pattern matching for searching media contents and online indexes. By default it treats search expressions as shell file patterns, using the Bourne shell file name metacharacters. For more complex searches you can choose to use full regular expressions.
File patterns
Backup3G attempts to match the full search string against the list of file names in the index or media contents table. The following expressions have special meanings in the search string:
Table 3 — Searching using file patterns
- match any number of characters, including null
? match any single character […] match any character in this set or range [!…] match any character not in this set or range
Here are some examples of using file patterns to match base directories: Pattern Matches Description /local/* /local/bin /local/fs All base directories under /local /local/g* /local/gif /local/gnats Any base directories starting with g under /local /l* /local /lib /lost+found Base directories starting with l in the root directory /l*/[ab]* /local/apps /local/bin /lib/acct /lib/adb Base directories starting with a or b that are subdirectories of the l directories in the previous example
Regular expressions
Backup3G uses similar rules to those of awk(1) to process regular expressions. In fact awk itself is used to handle many pattern searches, for example when you specify a partial file name to search online indexes.
Note - backup3G uses its own regexp library instead of the system’s regexp(3) library, as different versions of UNIX handle regular expressions in different ways.
Generally, any string matching regular expression (RE) will work the same in a backup3G pattern search as it would in an awk statement. For example:
. match any character [s] match any character in this set or range [^s] match any character not in this set or range ^ match the start of the string $ match the end of the string ? match 0 or 1 occurrences of the preceding RE + match 1 or more occurrences of the preceding RE | alternation – match either RE (…) group the enclosed characters into a RE
Note that the \{…\} construct is not supported. See the egrep(1) man page for more details.
Table 4 lists some examples of regular expressions used to match base directories:
Table 4 — Searching using regular expressions
The file name pattern can either be relative to the base directory or include the base directory name. For example, if the base directory is /usr, and you are searching for files under /usr/home/jdoe, enter /usr for Base directory/pattern. Any of the following patterns will work for Filename/pattern:
The base directory is optional. Its purpose is to limit the search to a subset of all the backups on the system. It is possible, though not recommended, to enter only a file Pattern Matches Description bin /bin /bin/save /usr/bin /usr/local/bin Base directories containing bin bin$ /bin /usr/bin /usr/local/bin Base directories ending in bin ^bin NO MATCH Base directories beginning bin. Nothing is selected, as all directories must start with / ^/bin /bin /bin/save Base directories beginning /bin /usr.$ /usr1 /usr2 Base directories ending in /usr plus one extra character Does not match /usr or /usr/bin /usr.*bin /usr/bin /usr/local/bin /usr2/bin Base directories beginning /usr and containing bin home/jdoe home/jd relative to base directory jdoe /usr.*j includes base directory
name and leave Base directory/pattern blank. In this case every online index will be searched. This may be very slow.
Note - Some backup3G prompt screens, such as ‘Search media indexes’ (Recover > Search > Files), let you enter both a base directory and a file name pattern. backup3G first selects the backups whose base directory matches the pattern, finds which of these backups has an index, then searches the indexed backups for files matching the file name pattern.
If you’re not sure of a file name, a good rule-of-thumb is to start with a fairly broad pattern search, then use the Search key to find the file in the resulting list. Another useful rule is to use the start and end date fields to limit the search even further.
Again, remember that broad searches can be very slow to process, depending on the number of indexes to be searched. On some systems a search may fail if the number of indexes is very large.
See To Recover Using Search on page 110 for step by step instructions.
Multi-part Recovery
When you do a full recovery of files from a multi-part backup step, the recovery job scans all the parts. When you recover selected files, backup3G displays a list of all files in the base directory. This is a concatenation of the indexes of all the parts. backup3G determines which parts must be read to recover the files you have requested, and which parts can be skipped.
If you enter the names of the files to be recovered, the recovery job will still scan the index to work out which parts to read. If the backup is not indexed, all parts will be read.
Loading of new volumes is handled in the same way as for the backup. If the tape is in a stacker or jukebox it is loaded automatically, otherwise a ‘change media’ request is made to the operator via the Backup Monitor.
Note - Multi-part recovery only works with backups created under backup3G or under COS/Manager 2.7. For old (pre-2.7) backups each part must be recovered individually.
Multi-step recovery
Backup3G supports multi-step recovery. Selected steps from the multi-step backup can be recovered to the original location or to a new location.
Restricting Recovery Destinations by Role
You may wish to restrict which target directories particular users can recover to. The ability to recover files is controlled by the ‘Recover by Roles’ table and by two capabilities: recover and recoverALL.
Users with the recoverALL capability can recover files to any directory on any remote backup3G host. Users with the recover capability can recover files subject to restrictions.
The ‘Recovery by Roles’ table (backup3G configuration > Maintain tables) lists the recovery restrictions for various roles. This is used to restrict which directories and hosts particular classes of user can recover files to.
Figure 8 — Sample set of recovery restrictions
For example, in Figure 8, users with the Operator role can recover to any directory on host morticia, /tmp and /local/ops on host mama, and /tmp on any other host. Users with the Admin role can recover to /tmp, /var, /opt, /users, and /local on host mama, and /tmp, /users, and /local on any other host.
Backup3G is installed with these defaults:
- the Manager role has recoverALL capability
- the Admin role has recover capability
- there are no predefined restrictions.
Note - Restrictions are inherited. A user with both the Admin and the Operator role inherits the restrictions of both roles.