Next Previous Contents

18. Preferences

Rather than having to issue a whole lot of command line options every time you wish to run backup/restore, it is possible to store commonly used options in a preference file. Individual users can have their own preference file in their ~ directory, or there can be a global preference file in /usr/local/etc. Both backup & restore look for a preference file in the following sequence:

  1. Check if a filename is given via -p (or --preference-file) command line option
  2. Check if a filename is given via environment variable TAPER_PREFS
  3. Check if ~/taper_prefs exists. If it does, use this
  4. Default of /usr/local/etc/taper_prefs
If no file is given, then internal defaults (as specified above) are used.

Note that command line options over-ride preference file and internal default settings.

18.1 Changing preferences

It is possible to change and save preferences within taper. Select the appropriate option from the taper menu (ie. either global options, backup options or restore options). To move between options, press the up or down arrows (or left and right). To change an option, use the left and right arrow keys. When you have finished, press F10 (to change this from F10, change the entry in defaults.h).

18.2 Saving preferences

There are two methods of saving your preferences. One is to a preference file or, the second is to a command line file. To save to a preference file, select the appropriate option. Give the filename of the preference file (default is ~/taper_prefs) and then press F. Next time you start taper, the preferences that you have selected will be automatically loaded.

The second method of saving is to a command line file. The saves the preferences you have selected to a shell script. Select the name of the shell script (default is start_taper). To invoke taper using the selected preferences, issue a `sh start_taper'. This is useful if you have temporary (or multiple) configurations and you don't want to overwrite your existing preference file.

18.3 Preference file format

The format of a preference file is a text file with one preference per line. A preference is given:


See the file 'pref_example' for an example of a preference file.

Spaces are ignored - use quotes if spaces are needed

The name of the preferences are the same as the long command line option name. For example, to change the log file to my_log_file, place the following line in your preference file:

log-file = my_log_file

18.4 Special preferences

The following preferences can be prefixed by a letter to indicate which tape drive they belong to.

For example, if you have the following line in your preference file,

block-size = 12300 z-block-size = 43122 z-tape-name = /dev/qft0 z-ntape-name = /dev/nqft0 s-tape-name = /dev/scsi s-ntape-name = /dev/nscsi -z

then the block-size is set to 43122 only if the zftape driver is selected, otherwise, it is set to 12300. Also, the device names are set to /dev/qft0 & /dev/nqft0 if the zftape driver is selected, or to /dev/scsi &/dev/nscsi if the scsi driver is selected. If the preference given is block-size=43122, then the block-size will be set to 43122 regardless of the tape driver selected.

Next Previous Contents