XBP Tutorial --> Overview --> User-Directed Operations --> Performing a Backup (or Archive) --> Performing a Restore --> Listing the Available Backups or Archives --> Restoring the Most Recent Backup --> Restoring the Most Recent Version of a Directory --> Redirecting Restores to Different Clients --> Selecting Specific Backup Dates to Restore --> Restoring an Earlier Version of a Directory --> Restoring a True Image of a Directory --> Resolving Links --> Checking the Progress of Operations --> Finding and Selecting Files and Directories ======== Overview The xbp utility is NetBackup client software that lets you back up, archive, and restore files, directories, or raw partitions that reside on your client system. In NetBackup terminology, the system that needs the backup or restore is the client. The system that manages the storage and retrieval of the backup data is called the NetBackup server. If you are licensed for optional NetBackup database agent software, you also can use xbp to invoke scripts that backup and restore databases. Using xbp, you browse your file system for files to backup/archive or for database agent scripts to invoke, or you browse the NetBackup database for files to restore. When you first start xbp, it begins in the default mode, browse the file system. You use this mode to browse for files and directories to back up or for database agent scripts to invoke for backup or restore operations. The other mode in xbp is browse the NetBackup database for items to restore. The Directory Structure pane and the Files pane show all directories and files in the directory specified in the Directory to Search box down to the level specified in the Directory Depth box. The Directory to Search box is set to the directory where you start xbp. You set the number of levels down in the Directory Depth box. See the Help > On Window topic for information about the xbp main window and how to navigate and select items. ======================== User-Directed Operations User-directed operations are NetBackup operations that the user can perform from the client. These operations can be performed without administrator intervention or logging into the NetBackup server. User-directed operations include the following: * Back up files, directories or raw partitions that reside on your local disk. A backup operation saves the data to a storage device on the NetBackup server. * Archive files and directories that reside on your local disk. An archive operation saves the selected files and directories to a storage device on the NetBackup server and then deletes them from your local disk. * Restore previously backed up or archived files, directories, or raw partitions to either the location from which they were backed up or to another location. You select what you want to restore and NetBackup automatically restores it to the disk. After you start a user-directed operation, the server manages storage and retrieval of data. All file transfers occur in the background so there is no long wait for the operation to complete before regaining control of your terminal. If you have optional VERITAS database agent software installed, you also can invoke scripts to backup and restore databases. ================================ Performing a Backup (or Archive) The following procedures explain how to perform a basic backup operation. An archive operation is the same as a backup except the files on the source system are deleted after the backup. The panes show the directories and files that are in the selected backups or archives and meet the following criteria: * Are in the Directory to Search box or in subdirectories below it in the client's directory tree (the Directory Depth box determines number of levels shown). * Are in the currently selected directory which matches the value in the Filename Filter box. 1. Change NetBackup master servers if necessary. If there is more than one master server to which you can send your backups and archives, ensure that you are connected to the correct one. Ask your NetBackup administrator if you have questions about which master server to use. Normally, you will not have to switch master servers unless, for some reason, the administrator has temporarily moved the NetBackup backups (for example, because of a problem on the original master server). a. Click Configuration on the File menu. The the xbp_config dialog box appears. The name of the current master server appears in the Server box. When you start xbp, the server is set to the default for your client. b. Type the name of the other server in the Server box. c. Click OK. If you typed an invalid name, or if your client does not belong to a NetBackup policy on that server, you get will an error. If this occurs, see your system administrator for assistance. 2. Find and select the desired files and directories. To select a file, click it; to deselect it, click it again. You can select any number of files, contiguous or noncontiguous. You can use Edit menu options to select all or deselect all items in a directory. You can change directories and select other files; all files selected are added to a selection list. To remove files selected in previous directories, click Edit > Discard Selections in Previous Directories. You can view the selected files by clicking Edit > Inspect All Selections. If the desired files or directories are not currently displayed, find them by changing search criteria and select them in the Files pane. 3. On the Backup menu, click Backup selected files and directories. This opens the xbp_confirm dialog box. Review your selections in the xbp_confirm dialog box: a. Select the Use log file checkbox to create a log file in your home directory and write to this file as the operation progresses. The name of the log file appears in the Log Filename box. b. Type a keyword in the Keyword phrase to associate with this backup operation. The phrase you type in the Keyword phrase to associate with this backup and can be used to search for the backup during a restore operation. c. Click OK. Your backup request is sent to the server, and the main xbp window appears. 4. To monitor the progess of the operation, select Backup > Report Progress of [Restore | Archive] then select the appropriate log file. ==================== Performing a Restore The following procedures explain how to perform a basic restore operation. The panes show the directories that are in the selected backups and meet the following criteria: * Are in the Directory to Search box or in subdirectories below it in the client's directory tree (the Directory Depth box determines the number of levels shown). * Were backed up within the time frame specified by the Range of Dates boxes. * Are in the currently selected directory which matches the value in the Filename Filter box. 1. Change NetBackup master servers if necessary. If there is more than one master server that can backup the client ensure that you are connected to the one that performed the backup. If you attempt to restore from another master server, the files will not be found. Ask your NetBackup administrator if you have questions about which master server to use. a. Click Configuration on the File menu. The the xbp_config dialog box appears. The name of the current master server appears in the Server box. When you start xbp, the server is set to the default for your client. b. Type the name of the other server in the Server box. c. Click OK. If you typed an invalid name, or if your client does not belong to a NetBackup policy on that server, you get will an error. If this occurs, see your system administrator for assistance. 2. Find the file and/or directory to restore. a. On the File menu, click Browse backups (restore). Note: If there are a large number of backups in your range of dates, a message box may appear indicating that you cannot search for a specific path until you update the display. If this message appears, select Update Display from the Edit menu. b. If necessary, specify the directory to search. Note: If there are any links in the path you are searching, NetBackup, by default, resolves the links so the path points to the actual file or directory. If you do not want to resolve links, click View > Do Not Resolve Links in Search Directory before choosing a browse command from the File menu. c. If necessary, specify the range of dates. d. If necessary, specify the keyword phrase to search for. If a keyword was specified during the backup process, you can search for backups by that keyword. e. Select the backup image(s) that contain the items you want to restore: * Select an image by clicking on it. * Selecting a specific backup changes both dates to show the backed up time for the selected backup. * Selecting a range of consecutive backups changes the date boxes to show the oldest and newest times in the selected range. * Selecting another backup cancels previous selections. If the list is longer than the window, a vertical scroll bar appears along the right edge. f. Update the information in the window by selecting Edit > Update Display or pressing Enter in any of the text boxes. g. Select the files and directories that you want to restore. To select a file, click it; to deselect it, click it again. You can select any number of files, contiguous or noncontiguous. You can use Edit menu options to select all or deselect all items in a directory. You can change directories and select other files in the backup images; all files selected are added to a selection list. To remove files selected in previous directories, click Edit > Discard Selections in Previous Directories. You can view the selected files by clicking Edit > Inspect All Selections. 3. Start the restore by clicking Restore > Restore selected files and directories. This opens the xbp_confirm dialog box. Review your selections in the xbp_confirm dialog box: a. Select the Use log file checkbox to create a log file in your home directory and write to this file as the operation progresses. The name of the log file appears in the Log Filename box. b. Select the Overwrite existing files checkbox to overwrite an existing file with the restored file, providing file permissions allow it. c. If you are a system administrator, you can choose to redirect the restore. d. Select Restore directories without crossing mount points to limit the restore to the local file system on the client. 4. Click OK. This will send your restore request to the server. The main window will appear. 5. To monitor the progess of the operation, select Restore > Report Progress of Restore then select the appropriate log file. ========================================= Listing the Available Backups or Archives If you are not sure of the dates when a file or directory was backed up, you can find out by browsing the backups. 1. Type the directory that you want to restore in the Directory to Search box. 2. Leave the range of dates at the defaults (01/01/70 to the current date). or If you know the approximate range, type it in to narrow the range that will be displayed. Doing this speeds up your request. 3. On the File menu, choose the desired browse for restore option. NetBackup updates the Directory Structure pane and the Files pane to show all backups or archives for the specified directory path and date range. Because NetBackup has to obtain the file information from the backups on the master server, there can be a noticeable delay before the panes appear in the restore window. Note If there are a large number of backups in the date range, you may be prompted to use Update Display from the Edit menu before NetBackup will search for the specific path. ================================ Restoring the Most Recent Backup The following explains how to restore the most recent backup that has occurred since the last full backup of your client. 1. Type the directory that you want to restore in the Directory to Search box. 2. On the File menu, click Browse backups (restore). NetBackup updates the Directory Structure pane and the Files pane to show only the files and directories that were backed up from the time of the last full backup through the most recent backup (either incremental or user-directed). Since NetBackup has to obtain the file information from the backups on the master server, there can be a noticeable delay before the panes appear in the restore window. Note By default, NetBackup restores the file to its original location. To restore to a different path, use Specify Destination Path from the Restore menu before starting the restore. 3. Select the most recent backup of the file you want to restore. Note If you are selecting directories on the Files pane and then change your mind and deselect a directory, it is not deselected until you have selected either Clear selections for current directory or Discard selections for previous directories from the Edit menu. If you use Inspect all selections from the Edit menu, you can see what is selected to be restored. 4. On the Restore menu, click Restore selected files and directories. This starts the restore. ================================================ Restoring the Most Recent Version of a Directory Note The following procedure will restore all files that existed in the directory from the time of the last full backup through the most recent backup. Files that were deleted from your online directory during that time period are also restored. You can restore the latest version of a directory with just one restore operation. The steps are the same as restoring from the most recent backup except that here you must select a directory from the Directory Structure pane and use Restore search directory from the Restore menu. The restored directory has the last full backup of that directory, updated with all subsequent incremental and user backups. There are two important things to remember when restoring a directory: * The restored directory has only the files that are in the range of backups you selected with the start and end dates. Therefore, these dates must include the last full backup and all other backups through the latest date you are interested in. The best way to get the most recent backup is to use the date of the last full backup as start date and the current date as the end date (this is the default at the start of a browse). * It is usually best to select from the Directory Structure pane. Selecting from the Files pane restores only from the backup created at the backup date and time. If that backup is for an incremental, you will restore only the files in that incremental. ========================================= Redirecting Restores to Different Clients The following explains how to redirect a restore to a different client. Note You cannot use NetBackup on the master server to restore a file to an alternate path on a NetBackup for Novell NetWare client. For those clients, you must perform the alternate path restore with the user interface on the NetWare client. 1. Change NetBackup master servers if necessary. a. From the File menu, click Configuration. This opens the xbp_config dialog box. b. Type the name of the server in the Server box. c. Click OK. If you type an invalid name or your client does not belong to a NetBackup policy on that server, you will get an error. See your system administrator for assistance. 2. From the Restore menu, click Specify Destination Path. This opens the xbp_destpath dialog box. a. Type the paths in the Restore From box and the Restore To box. You can also use the Current Directory button to change paths to their default value, which is your current directory. You cannot specify more than one path. If you specify a path that does not exist, NetBackup creates it when restoring the file. b. Before restoring files that are links, choose whether to update those link pathnames: * Select the Rename Hard Links checkbox to rename the hard link pathnames. Clear the Rename Hard Links checkbox if you do not want to rename the hard link pathname. * Select the Rename Soft Links checkbox to rename the soft link pathnames. Clear the Rename Soft Links checkbox if you do not want to rename the soft link pathname. Note If you are restoring system files to a disk other than the current system disk and plan on using the other disk as the system disk with the original file paths when the restore is completed, we suggest that you select the Rename Hard Links checkbox and clear the Rename Soft Links checkbox. This will let you use the other disk and have the correct file paths. c. Confirm or cancel the changes as follows: * Click OK to use the paths indicated in the Restore From box and the Restore To box on the next restore. or * Click Cancel to cancel the changes so the previous paths are used. 3. On the File menu, click Browse backups (restore). 4. Specify the directory to search, the range of dates, the keyword phrase to search for, the directory depth, and the filename filter for the files you want to restore. 5. Find and select the files and directories that you want to restore. 6. Click the appropriate restore command on the Restore menu. This opens the xbp_confirm dialog box. a. Select the Use log file checkbox to create a log file in your home directory and write to this file as the operation progresses. b. Select the Overwrite existing files checkbox to overwrite an existing file with the restored file, providing file permissions allow it. The checkbox is selected when highlighted. Clear the Overwrite existing files checkbox to prevent overwriting. The restore does not occur if a file with same pathname already exists. c. Select the Redirected restore checkbox to confirm the restore to a different path. The checkbox is selected when highlighted. Clear the Redirected restore checkbox to cancel the redirection action. d. Select the Restore directories without crossing mount points checkbox to skip over file systems mounted in the selected directories. The checkbox is selected when highlighted. Clear the Restore directories without crossing mount points checkbox to restore file systems that are mounted in the selected directories. e. Review your selections. f. Click OK to start to start the restore. The main window displays. To return to the main window without starting the restore, click Cancel. ========================================== Selecting Specific Backup Dates to Restore By default, the NetBackup Restore window shows the files and folders that were backed up since the last full backup. The default range will satisfy the majority of your needs to restore files but there will be times when you must restore a file that was not backed up during the default time period. For example, a file that was deleted prior to the last full backup will not appear in the default display. To search for and restore this file, you must change the date range. If the client belongs to more than one policy, the starting date defaults to the last full backup that occurred first. For example, assume that: (1) a client belongs to PolicyW1 and PolicyW2, (2) Full backups occur for both of these policies, (3) PolicyW1s most recent full backup occurred on June 16 and PolicyW2s most recent full backup occurred on June 24. NetBackup will display those files and folders that have been backed up since the PolicyW1 full backup on June 16. If the default display does not show the desired files or directories: 1. Specify the range of backup dates that you believe contains the desired files and directories: * Type the desired backup dates in the Range of Dates boxes. or * Select backups from the Backup Images pane. The Range of Dates boxes will now contain the oldest and newest backup dates in the range of backups that you selected. Note Narrow the date range as much as possible to speed up your search. 2. Position the pointer over any of the boxes and press Enter (or click Update Display on the Edit menu). NetBackup updates the Directory Structure pane and the Files pane to show only the files and directories that it finds in the range of backups that you specified. You can then select the backup you want and restore it. Since NetBackup has to obtain the file information from the backups on the master server, there can be a noticeable delay before the panes appear in the restore window. =========================================== Restoring an Earlier Version of a Directory The following procedure will restore all files that were backed up during the range of backup dates that you searched for files to restore. This includes files that were deleted from your online directory after they were backed up. To restore a version of a directory that existed prior to the last full backup, select only the backups that include the desired version of the directory. > To restore an earlier version of a directory 1. Browse all dates and examine the Files pane and the Backup Images pane. 2. Set the start date and end date to include the required backups. 3. Start another browse using Update Display from the Edit menu. 4. Select the directory from the Directory Structure pane and the check the Files pane to see if it shows the files you need. Note By default, NetBackup restores the directory to its original location. To restore to a different path, use Specify Destination Path from the Restore menu before starting the restore. Note If you are selecting directories on the Files pane and then change your mind and deselect a directory, it is not deselected until you have selected either Clear selections for current directory or Discard selections for previous directories from the Edit menu. If you use Inspect all selections from the Edit menu, you can see what is selected to be restored. 5. On the Restore menu, click Restore search directory. ===================================== Restoring a True Image of a Directory A true image restore of a directory, by default, restores the directory so its contents are exactly what they were at the time of the most recent automatic full or incremental backup. Files deleted prior to the specified backup are not restored. If you are overwriting the directory you are restoring, NetBackup does not delete files that are currently in the directory but not in the true image restore backups. Note You can restore a true image of a directory only if the NetBackup policy that is backing up your files and directories is configured to collect true image restore information. If you are in doubt, ask your NetBackup administrator. Note NetBackup does not allow a true image restore that is based on the time of a user-directed operation. However, NetBackup does use the data from a user-directed operation when performing a true image restore if the user backup is more recent than the latest automatic full or incremental backup. 1. On the File menu, click Browse backups (true image restore). The Directory Structure pane and the Files pane show the directories that are available for true image restores. Notice that the panes show only directories. Individual files do not appear because true image restores are intended only for restoring entire directories. To list or select individual files, use the Browse backups (restore) mode. Note If NetBackup does not find any directories, check the range of dates, path, and directory depth. If these settings are correct and no directories are found, check with the administrator on the master server to see if the NetBackup policy that is backing up your files and directories is configured to collect true image restore information. 2. Select the desired range of dates. The default start date is the time of the last scheduled full backup of the policy. Use the default unless you are restoring a version that existed before the latest full backup. The default end date is the current date. If necessary, change this value to reflect the date that you want to recover. 3. If you changed the range of dates in step 2, click Update Display on the Edit menu to update the panes. This step is unnecessary in our example, but is required if you change the range of dates. 4. From the Files pane, select the directory that you want to restore. (NetBackup does not let you select from the Directory Structure pane for a true image restore.) Note If you are selecting directories on the Files pane and then change your mind and deselect a directory, it is not deselected until you have selected either Clear selections for current directory or Discard selections for previous directories from the Edit menu. If you use Inspect all selections from the Edit menu, you can see what is selected to be restored. Note By default, NetBackup restores the directory to its original location. To restore to a different location, use Specify Destination Path from the Restore menu before starting the restore. 5. On the Restore menu, click Restore selected files and directories. (Restore search directory is not available for a true image restore.) If you are overwriting the directory you are restoring, NetBackup does not delete files that are currently in the directory but not in the true image restore backups. =============== Resolving Links When searching for files to restore, you can choose whether to have NetBackup resolve links that may exist in the search path. If you resolve links, NetBackup automatically changes the path so it points to the actual file or directory. Otherwise, NetBackup uses the path you type in. Note xbp resolves links by default, unless you click Do Not Resolve Links in Search Directory on the View menu before starting your search. Note NetBackup does not resolve links if you use wildcard characters in the search directory path. =================================== Checking the Progress of Operations When you start a NetBackup operation, you can have NetBackup create a log file in a directory of your choice and write to this file during the course of the operation. By default, NetBackup creates a log file in your home directory of the form: bplog.bkup.n (for backups) bplog.arch.n (for archives) bplog.rest.n (for restores) Where n is a number that is unique for each file. This dialog box lists the progress log files that are in your home directory and lets you view them. (You can also read log files by using the more command or a UNIX file editor.) The log information is in two scrollable panes: * Log files in your $HOME directory (upper section of dialog) * Contents of selected log file (middle section of dialog) View the contents of a log by selecting and highlighting its entry in the upper pane. The pane in the middle section displays any entries that NetBackup makes in the log file. Select the Automatic Refresh checkbox for automatic refresh. You can force a refresh by reselecting the same log file. The checkbox is selected when highlighted. When you are through checking progress, click Close to return to the xbp_main window. -------------------------- Interpreting Progress Logs The log messages notify you of important events that occur during the operation. These messages can have acronyms that specify the error level severity of an event. The error level acronyms are as follows: INF Informational message (no error occurred) TRV Trivial error message WRN Warning error message ERR Error message FTL Fatal error message Progress logs also list the media required for a NetBackup operation. For backups, the progress log lists the media IDs as NetBackup requests them during the course of the backup. For restores, the progress log begins by listing all the media IDs that NetBackup needs to recover the backups containing the files. If a backup or archive is split across more than one media ID, a restore log lists all the media but NetBackup uses only what it needs to restore the requested files. Check the status at the end of the log to determine the final results of the NetBackup operation. If NetBackup was unable to back up or restore all the requested files, check the exit status that appears a few lines before the end of the log. This status will usually reveal the cause of the problem. -------------------- E-mail Notifications You can configure a bp.conf file in the client $HOME directory so the user will receive e-mail notifications on the results of user-directed operations. For more information, see Configuring E-mail Notifications in the NetBackup System Administrators Guide for UNIX, Volume II. --------------------------- Deleting Progress Log Files To delete log files from your directory, open the xbp_progress dialog box, select the log files and click Delete Log File. You can also delete logs manually by using system commands. Note Before deleting the log files, verify that they do not contain warnings or error messages. --------------------------------------------- Obtaining a List of Your Backups and Archives You can use the bplist command to get a listing. The bplist command lists backups and archives according to criteria, such as specific file or directory, client name, and range of dates. You can print a list by sending it to a file and then printing the file. For detailed instructions on using this command, see the bplist man page. =========================================== Finding and Selecting Files and Directories This following explains how to find and select files and directories. -------------------------------- Navigating in the Directory Tree > To go lower in the directory tree * Double click on a lower level directory in the Directory Structure pane. or * Click the directory and press Enter. The Directory to Search box will show the selected directory, and the Directory Structure pane and the Files pane are updated accordingly. or * Type the directory path in the Directory to Search box and press Enter. This has the same effect as clicking the directory in the Directory Structure pane. > To go higher in the directory tree * Type the path of the higher level directory in the Directory to Search box and press Enter. Pressing Enter updates the display (another way to update the display is to click Update Display on the Edit menu). -------------------------------- Show the Contents of a Directory To see files that are in a directory, click the directory in the Directory Structure pane. The contents appear in the Files pane. -------------- Filter by Date To show only files that were modified or backed up within a certain date range, set the Range of Dates boxes to include those dates and press Enter to update the display: * For a backup, specify the last modified dates. * For a restore, specify backup dates. You could set the range of dates to show only those modified before or after a certain date. For example, you could pick only todays files. ------------------- Filter by File Name To show only specific file names that are under the Directory to Search box, use the Filename Filter box. This makes selection easier if you want only specific files but there are many files under Directory to Search box. For example, you can find files ending in .doc by using the filter expression *.doc. When xbp starts, the filter is set to * and displays everything. Change the Number of Directory Levels Displayed To set the number of directory levels displayed, change the number in the Directory Depth box (default is 2). Selecting File or Directory for Backup, Archive, or Restore To select a file or directory in the Files pane, click its name to highlight it. Clear a file or directory by clicking it again: * To select everything in the current directory, click Select all in current directory on the Edit menu. Clear an individual file or directory by clicking it again. * To clear all selections for the current directory, click Clear selections for current directory on the Edit menu. Caution If you click on Select all in current directory on the Edit menu to perform a NetBackup operation, and the directory you select is large, the operation can be very slow. Instead of selecting everything, consider using Restore search directory, Backup search directory or Archive search directory. During a backup, selecting a directory from the Files pane implicitly selects everything in the directory, including subdirectories and files. During a restore, selecting a directory in the Files pane restores only the files and subdirectories that are in the backups that occurred during the indicated range of dates. You select from the Directory Structure pane in the same manner as from the Files pane, except that you can select only one item at a time. When you select a directory to highlight it, the Files pane shows the directories and files in this directory. When you are through selecting, start the NetBackup operation by choosing the appropriate option from the Backup menu or Restore menu. This opens the xbp_confirm dialog box and adds your selections to that dialog. If you made previous selections and opened the xbp_confirm dialog box but did not confirm your selections (and therefore did not perform the actual NetBackup operation), xbp remembers them and keeps them in the xbp_confirm dialog box. This lets you return to the main window and make changes before confirming. To clear all selections from the xbp_confirm dialog box, click Discard selections for previous directories on the Edit menu. ------------------------- Previewing Selected Files You can view the list of selected files at any time by clicking Inspect all selections on the Edit menu. This opens a dialog box similar to xbp_confirm, except that it does not have an OK button. ------------------------ Show Directory Structure To indent items in the Directory Structure pane to show the directory hierarchy, click Indented tree structure on the View menu. This is the default. To view the full pathnames of directories in the Directory Structure pane, click Full Pathnames on the View menu. ------------------------------------- Show Number of Directory Levels Shown To modify the number of subdirectory levels that appear in the Directory Structure pane and the Files pane, modify the Directory Depth box. ------------------------------- Show Most Recent or All Backups For a restore, you can choose from the View menu to display either All backup dates for each file or Only most recent backup date. ----------------- Show File Details To view file details (for example, file size and write permissions), click Verbose display of attributes and filenames on the View menu. To view filenames without details, click Brief display of filenames (default). ------------------ Update the Display To update the NetBackup window to show the most recent changes (such as file additions or deletions), click Update Display on the Edit menu.