ArGest Backup User Guide

  1. Home
  2. Docs
  3. ArGest Backup User Guide
  4. Advanced Terminal Operation
  5. Command Line Examples

Command Line Examples

BRU LE for Mac OS X’s command line is designed for maximum functionality from the OS X Terminal command line (or a standard XTerm if you’re running X11 for OS X). The following samples are designed to provide an idea of what BRU is capable of. In these examples, please remember to issue a

'tapectl -f ntape0 rewind' command to return the tape to its starting point.
Archive creation uses the -c option (for create). To backup the full system, simply list / (slash, or root) as the file list argument:

bru -cvf ntape0 /

This command will backup everything on your system (including any mounted volumes) to the non-rewinding device ntape0. The output will provide a simple listing of the files as they are processed:

/bin/pwd
/bin/rcp
/bin/rm
/bin/rmdir
/bin/sh
/bin/sleep
/bin/stty
/bin/sync
/bin/tcsh
/bin/test
/bin/writecnt

If you wish to increase the amount of information provided, simply increase the number of -v’s (up to 5):

bru -cvvvf ntape0 /
The results now look like:
c 2554K [1] /bin/pwd
c 2572K [1] /bin/rcp
c 2602K [1] /bin/rm
c 2626K [1] /bin/rmdir
c 2644K [1] /bin/sh
c 3250K [1] /bin/sleep
c 3262K [1] /bin/stty
c 3292K [1] /bin/sync
c 3306K [1] /bin/tcsh
c 3660K [1] /bin/test
c 3678K [1] /bin/writecnt symbolic link to /bin/bru

Since BRU sends all normal output to stdout, you may use standard UNIX-style redirection to save the output of any BRU operation to a file (or pipe it to other commands).

bru -cvvvvvf ntape0 / > /tmp/osxfull.log

This will create a file in your /tmp directory that contains the output results of the BRU operation. Additionally, you may send BRU’s operation to the background by adding the standard ‘&’ character to the end of the command line.
To examine the contents of a BRU archive, use the table of contents command -t. By default, -t automatically prints the names of the files in the archive. However, you may increase this output by increasing the number of v’s as above in the create process.
To perform a restore of data, we use the -x option (extract). Assuming we’d completed a backup of our entire system, the following line would restore the /System/Library/Frameworks, not overwriting any files that are already on the system (-E):

bru -xvvvf ntape0 -E /System/Library/Frameworks

If we prefer to overwrite the existing files, change the -E to -ua:

bru -xvvvf ntape0 -ua /System/Library/Frameworks

In this example, BRU will make use of a SmartRestore patterns file to ensure that any ‘in use’ Frameworks are not clobbered by the restore. In the case a Framework is in use, BRU will relocate the currently busy content and replace it with the restored copy. The system will continue to access the currently open files until either that Framework is no longer needed, or until the next system reboot. For more information, please refer to Chapter 18.
The key to BRU’s ability to monitor the quality of a backup lies in its verification capabilities. During a backup, BRU will recognize most common tape errors and report them. This is great for the current status, but what about a tape that’s 4 months old? By using BRU’s -i option (inspect), you can examine the contents on any BRU tape, even if it was not made on your system. This allows you to ensure the validity of your backups at any time, on any system with a similar tape device and a copy of BRU.
bru -ivvvf ntape0

This command will list any discrepancies in the archive and ensure that the maximum amount of data is always available, even in the event of hard media errors.
If you are verifying a backup on the same system on which it was created, the differences mode (-d) will let you know of any differences that exist between the system and the backup contents. This is a great method for comparing a potentially compromised system to a known good backup. BRU will report any changes, additions, or deletions on the system.

bru -ddddf ntape0