Thursday, May 10, 2012

bprestore manual

NAME
      bprestore - restores files from the NetBackup server

SYNOPSIS
      /usr/openv/netbackup/bin/bprestore [-A | -B] [-K] [-l | -H | -y] [-r]
           [-T] [-L progress_log] [-R rename_file] [-C client] [-D client]
           [-S master_server] [-t class_type] [-c class] [-s mm/dd/yy
           [hh:mm:ss]] [-e mm/dd/yy [hh:mm:ss]] [-w [hh:mm:ss]] [-k
           "keyword_phrase"] -f listfile | filenames

DESCRIPTION
      bprestore lets users restore a backed up or archived file or list of
      files. You can also name directories to restore. If you include a
      directory name, bprestore restores all files and subdirectories of
      that directory.

      By default, you are returned to the system prompt after bprestore is
      successfully submitted. The command works in the background and does
      not return completion status directly to you. The -w option lets you
      change this behavior so bprestore works in the foreground and returns
      completion status after a specified time period.

      The bprestore command restores the file from the most recent backups
      within the time period you specify, except for a true-image restore
      (see the -T option description)."

      Use the bplist command to display information on the files and
      directories that were backed up or archived.

      bprestore writes informative and error messages to a progress-log file
      if you create the file prior to the execution of the bprestore command
      and then specify the file with the -L progress_log option. If
      bprestore cannot restore the requested files or directories, you can
      use the progress log to find the reason for the failure.

      For detailed troubleshooting information, create a directory named
      /usr/openv/netbackup/logs/bprestore with public-write access.
      bprestore then creates an activity log file in this directory.

      In addition, if a nonroot user specifies USEMAIL = mail_address in
      their $HOME/bp.conf file, NetBackup sends mail on the restore
      completion status to mail_address. This message is sent when the
      restore process is complete.

      The following restrictions apply to bprestore:

      o    You can restore files and directories that you own and those
           owned by other users if you have read access. You need write
           access to another user's directories and files to restore that
           user's files to their original location.

      o    The operating system restricts the number of files and
           directories that you can specify on a single bprestore command
           line. If this is a problem, use the -f option to restore the
           files.

OPTIONS
      -A | -B   Specifies whether to restore from archives (-A) or backups
                (-B). The default is -B.

      -K        Specifying this option causes bprestore to keep existing
                files rather than writing over them when restoring files
                with the same name. The default is to overwrite existing
                files.

      Note:     The -l | -H | -y options apply only when restoring UNIX
                files to a UNIX system.

      -l | -H | -y
                Specifying -l renames the targets of UNIX links by using the
                -R rename_file option in the same way as when renaming
                files.

                Specifying -H renames UNIX hard links by using the -R
                rename_file option in the same way as when renaming files.
                Soft links are unchanged.

                Specifying -y renames UNIX soft links by using the -R
                rename_file option in the same way as when renaming files.
                Hard links are unchanged.

                See Example 5 in the EXAMPLES section.

      -r        Specifying this option restores raw partitions instead of
                file systems.

      -L progress_log
                Specifies the name of an existing file in which to write
                progress information.

                For example: /home/tlc/proglog

                The default is to not use a progress log.

      -R rename_file
                Specifies the name of a file with name changes for
                alternate-path restores.

                Use the following form for entries in the rename file:

                change backup_filepath to restore_filepath

                Where:

                The file paths must start with / (slash)

                The first backup_filepath that is matched is replaced with
                the restore_filepath string. The default is to restore using
                the original path.

                For example, the following entry renames /usr/fred to
                /usr/fred2:

                change /usr/fred to /usr/fred2

      -C client Specifies a client name to use for finding backups or
                archives from which to restore files. This name must be as
                it appears in the NetBackup catalog. The default is the
                current client name.

      -D client Specifies a destination client. This can be done by a root
                user on the master server in order to direct the restored
                files to a machine other than the client specified with the
                -C option.

      -S master_server
                Specifies the name of the NetBackup server. The default is
                the first server found in the /usr/openv/netbackup/bp.conf
                file.

      -t class_type
                Specifies one of the following numbers corresponding to the
                class type (the default is 0 on all clients except Apollos,
                where it is 3):

                0 = Standard

                4 = Oracle

                6 = Informix-On-BAR

                7 = Sybase

                10 = NetWare

                13 = MS-Windows-NT

                14 = OS/2

                15 = MS-SQL-Server

                16 = MS-Exchange-Server

                19 = NDMP


      Note:     The following class types (Apollo-wbak, DataTools-SQL-
                BackTrack, Auspex-FastBackup, SAP, DB2, FlashBackup, Split-
                Mirror, and AFS) apply only to NetBackup DataCenter.

                3 = Apollo-wbak

                11 = DataTools-SQL-BackTrack

                12 = Auspex-FastBackup

                17 = SAP

                18 = DB2

                20 = FlashBackup

                21 = Split-Mirror

                22 = AFS

      -C class  Specifies the class for which the backups or archives were
                performed.

      -s mm/dd/yy [hh:mm:ss]

      -e mm/dd/yy [hh:mm:ss]
                Specifies the start and end date range for the listing. The
                bprestore command restores only files from backups or
                archives that occurred within the specified start and end
                date range.

      Note:     The locale setting for the system affects the way you must
                specify dates and times. See the NOTES section of this
                command description.

                -s specifies a start date and time for the restore window.
                bprestore restores files only from backups or archives that
                occurred at or after the specified date and time. Use the
                following format:

                mm/dd/yy [hh[:mm[:ss]]]

                The valid range of dates are from 01/01/70 00:00:00 to
                01/19/2038 03:14:07. The default start date is 01/01/70
                00:00:00.

                -e specifies an end date and time for the restore window.
                bprestore restores only files in backups or archives that
                occurred at or before the specified date and time. Use the
                same format as for the start date and time.

                The end backup date and time do not need to be exact, except
                for a true-image restore (see the -T option description).
                The bprestore command restores the file that has the
                specified backup date and time or the file that is the most
                recent backup preceding the end date and time. The default
                is the current date and time."

                If you do not specify either -s or -e, bprestore restores
                the most recently backed up version of the file.

      -T        Specifies a true-image restore, where only files and
                directories that existed in the last true-image backup are
                restored. This option is useful only if true-image backups
                were performed. If this option is not specified, all files
                and directories meeting the specified criteria are restored,
                even if they were deleted.

                When the -T option is specified, the image requested must be
                uniquely identified. Unique identification is accomplished
                by using the -e option  with seconds granularity. The -s
                option, if any, is ignored. The seconds granularity of an
                image can be retrieved by using the bplist command with the
                -l and -Listseconds options.

      -w [hh:mm:ss]
                Causes NetBackup to wait for a completion status from the
                server before returning you to the system prompt.

      Note:     The locale setting for the system affects the way you must
                specify dates and times. See the NOTES section of this
                command description.

                You can optionally specify a wait time in hours, minutes,
                and seconds. The maximum wait time you can specify is
                23:59:59. If the wait time expires before the restore is
                complete, the command exits with a timeout status. The
                restore, however, still completes on the server.

                Specifying 0 or not specifying a time, means wait
                indefinitely for the completion status.

      -k "keyword_phrase"
                Specifies a keyword phrase for NetBackup to use when
                searching for backups or archives from which to restore
                files. The phrase must match the one that was previously
                associated with backup or archive by the -k option of the
                bpbackup or bparchive command.

                You can use this option in place of or in combination with
                the other restore options in order to make it easier to
                restore your backups and archives. The following meta
                characters can simplify the task of matching keywords or
                parts of keywords in the phrase:

                * matches any string of characters.

                ? matches any single character.

                [ ] matches one of the sequence of characters specified
                within the brackets.

                [ - ] matches one of the range of characters separated by
                the "-".

                The keyword phrase can be up to 128 characters in length.
                All printable characters are permitted including space (" "
                ) and period ("."). The phrase must be enclosed in double
                quotes ("...") or single quotes (`...') to avoid conflict
                with the UNIX shell.

                The default keyword phrase is the null (empty) string.

      -f listfile
                Specifies a file (listfile) containing a list of files to be
                restored and can be used instead of the filenames option. In
                listfile, list each file path on a separate line.

                The format required for the file list depends on whether the
                files have spaces or newlines in the names.

                To restore files that do not have spaces or newlines in the
                names, use this format:

                filepath

                Where filepath is the path to the file that you are
                restoring. For example:

                /home

                /etc

                /var

                To restore files that have spaces or newlines in the names,
                use one of the following formats:

                filepathlen filepath

                filepathlen filepath start_date_time end_date_time
         
                filepathlen filepath -s date_time -e date_time

                Where:

                filepath is the path to the file you are restoring.

                filepathlen is the total number of characters in the file
                path.

                start_date_time and end_date_time are the decimal number of
                seconds since 01/01/70 00:00:00.

                datetime is the same as the command line (mm/dd/yy
                [hh[:mm[:ss]]]). The start and end date and time specified
                on the command line is used unless a line in listfile
                overrides it. The dates may change from line to line.

                The following is an example that uses filepathlen filepath:

                5 /home

                4 /etc

                4 /var

                19 /home/abc/test file

      filenames Names one or more files to be restored and can be used
                instead of the -f option.

                Any files that you specify must be listed at the end,
                following all other options. You must also specify absolute
                file paths.

NOTES
      The format that you must use for date and time values in NetBackup
      commands depends on the locale setting. The examples in this command
      description are for a locale setting of C.

      If you are uncertain of the NetBackup command requirements for your
      locale, enter the command with the -help option and check the usage.
      For example:

           /usr/openv/netbackup/bin/bprestore -help
           USAGE: bprestore [-A | -B] [-K] [-l | -H | -y] [-r] [-T]
                 [-L progress_log] [-R rename_file] [-C client]
                 [-D client] [-S master_server] [-t class_type]
                 [-c class] [-k "keyword phrase"]
                 [-s mm/dd/yy [hh:mm:ss]] [-e mm/dd/yy [hh:mm:ss]]
                 [-w [hh:mm:ss]] -f listfile | filenames

      Notice the month/day/year and hours:minutes:seconds requirements for
      the -s and -e  options. These are for a locale setting of C and can be
      different for other locales.

      For more information on locale, see the locale(1) man page for your
      system.

EXAMPLES
Example 1
      To restore a file from backups of /usr/user1/file1  that were
      performed between 04/01/93 06:00:00 and 04/10/93 18:00:00, enter the
      following (all on one line):

      bprestore -s 04/01/93 06:00:00 -e 04/10/93 18:00:00 /usr/user1/file1

Example 2
      To restore files listed in a file named restore_list by using the most
      recent backups, enter the following:

      bprestore -f restore_list

Example 3
      To restore the directory /home/kwc from the backups that are
      associated with a keyword phrase that contains "My Home Directory" and
      use a progress log named /home/kwc/bkup.log, enter the following (all
      on one line):

      bprestore -k "*My Home Directory*" -L /home/kwc/bkup.log  /home/kwc

Example 4
      To restore the D drive on the Windows NT client slater from the
      backups that are associated with a keyword phrase that contains "My
      Home Dir" and use a progress log named /home/kwc/bkup.log, enter the
      following (all on one line):

      bprestore -k "*My Home Dir*" -C slater -D slater -t 13 -L
      /home/kwc/bkup.log  /D

Example 5
      Assume you have a rename file named /home/kwc/rename on a UNIX client
      and it contains the following:

      change /home/kwc/linkback to /home/kwc/linkback_alt

      To restore the hard link named /home/kwc/linkback to alternate path
      /home/kwc/linkback_alt on that client, execute:

      bprestore -H -R /home/kwc/rename /home/kwc/linkback

FILES $HOME/bp.conf /usr/openv/netbackup/logs/bprestore/log.mmddyy SEE ALSO bp(1), bparchive(1), bpbackup(1), bplist(1)

No comments:

Post a Comment