AFRESTORE(8)

NAME
afrestore - the restore utility of the afbackup package

SYNOPSIS
afrestore [-nl] [ -<past-backup-no> ] [ -C <root-directory> ] [ -h <backuphosts> ] [ -P <backup-ports> ] [ -c <configuration-file> ] [ -A "<after-date>" ] [ -B "<before-date>" ] [ -I <indexfile-part> ] [ -V <var-directory> ] [ -k <encryption-key-file> ] [ -z <compress-cmd> <uncompress-cmd> ] [ -p ] <path-pattern> [ [ -p ] <path-patterns> [ ... ] ]
afrestore -a [ -<past-backup-no> ] [ -C <root-directory> ] [ -h <backuphosts> ] [ -P <backup-ports> ] [ -c <configuration-file> ] [ -I <indexfile-part> ] [ -V <var-directory> ] [ -k <encryption-key-file> ] [ -z <compress-cmd> <uncompress-cmd> ]
afrestore -{ef} [ -C <root-directory> ] [ -h <backuphosts> ] [ -P <backup-ports> ] [ -V <var-directory> ] [ -z <compress-cmd> <uncompress-cmd> ] [ -k <encryption-key-file> ] [ -c <configuration-file> ] < <startup-info-file>
afrestore -E [ -nl ] [ -C <root-directory> ] [ -h <backuphosts> ] [ -P <backup-ports> ] [ -V <var-directory> ] [ -z <compress-cmd> <uncompress-cmd> ] [ -k <encryption-key-file> ] [ -c <configuration-file> ] [ -H <orig-host> ] [ <cartridge-number> | <cartridge-range> ] ... ]

DESCIPTION
The first form can be used for restoring selected pieces of a certain previous backup run. If no option of the type -<past-backup-no> is supplied (e.g. -2 ), the most recently made backup is accessed. If an option like this is given, the backup system tries to extract the files from the backup before ( -1 ) or even an earlier one. This requires, that enough file- and directory-name-logging is provided. This can be done with the client-side configuration parameter NumIndexesToStore (See: afclient.conf(8)). The parameters <path-pattern> indicate, which files and directories should be restored. An asterisk is implicitely put before and after the <path-pattern>, so it is assumed to be a substring of the path. This can be prevented preceding the <path-pattern> with the option -p. These may be wildcards for the full path name leading to the file relative to the directory, to that the client changes before starting any backup or restore (See under the parameter RootDirectory under afclient.conf(8)). Note, that you have to put these into quotes, if you are using wildcards to prevent substutition. It is a bad idea to restore a total backup entering: restore "*" This leads to a huge filelist to be processed by the client, what might plug up memory and/or temporary space in some filesystem. Instead you should use the second form with the option -a, what restores a total backup. The third form restores without looking for filename log files. Instead it reads the standard input for information, where to extract from. The format expected at standard input is the same as produced by incr_backup or full_backup, if the configuration option StartupInfoProgram is used. The given program is then supplied with the appropriate information and should write it to some place outside the local host, so that it will not be affected by a hard crash (see: StartupInfoProgram in afclient.conf(8)). The fourth form scans the cartridges (if supplied) on the given servers (if supplied, eventually with alternate given port numbers - see below for the format, how to specify cartridge/host/port-triples) for backups done from the host, where the restore program is started and restores everything it finds. The functionality is similar to -e, but no input has to be supplied. If the client's hostname has changed or restore should be done on another host, the original hostname must be supplied with the -H option. Otherwise nothing or the wrong stuff will be restored. Scanning the cartridges can take a lot of time, but it should be several minutes, not hours. Cartridges can be supplied in three forms as arguments: simple numbers, ranges (e. g. as 3-5 without spaces), and ranges relative to the actual backup writing position (e. g. as -3). In the latter case -0 means the cartridge, that will be written to next time i.e. that holds the actual writing point. -2 stands for the latest 3 cartridges. To indicate, that a cartridge is located at a certain backup server, maybe with a special port number (if there are several backup servers), the cartridge number or range can be followed by the at-character @, optionally followed by the percent character % and the port number, e. g. 3-5@buhost%2989 . No whitespace is allowed in such a specifier. If no port is given, the default port is assumed (2988). If no hostname is given, the default backup server is used. Default backup server is the first one in the list, that is configured in the parameter file or overriden by the option -h. Any number of ranges or numbers can be supplied, overlapping duplicates are ignored. If no cartridge numbers are given, the program searches backward from the actual writing position on each configured backup server until it thinks, it has enough backups found, or all cartridges on that server have been tried. The found backups are sorted in the correct order (using the stored backup time) and afterwards everything found is restored. This form of the command needs no information at all for an emergency restore. If the configuration file is not supplied explicitely, then it is searched for in the @clientlibdir@ and if not found there the files /etc/buclient.conf and /etc/afbackup/client.conf are tried.

-A <date>
    restore files modified after the given date. The date should be put into quotes, cause it usually contains whitespace. Valid formats are e.g.:
      MM/DD/YYYY hh:mm:ss
      DD.MM.YYYY hh:mm:ss
    or the formats produced by ctime(3) or date(1). The year may be supplied in two digits or in the non-US- formats be omitted, then the current year is assumed. The seconds may also be omitted (hh:mm), the whole time may be left off, then 00:00 is assumed. Thus the shortest valid format is DD.MM

-B <date>
    restore files modified before the given date. See -A for the valid date formats

-C <rootdir>
    change to the given root-directory before restoring files instead of the one specified in the client side configuration file. If this directory does not exist, it is created

-c <configfile>
    use the given file for configuration information

-e  restore all files from the previous backup in an emergency case without looking for the filename logfiles, which are also restored

-f  restore only the filename logfiles in an emergency case

-H <orighost>
    (in combination with -E) Restore everything saved from the given host, if different from the one, where the program is running. Domainnames or anything behind (and including) a dot in this hostname is ignored

-h <hostnames>
    Use the given list of hosts as backup servers. This list is used only, if no hostname information can be found as associated with the actual filesystem entry, that should be restored. The first host in this list is the default server, if no hostname information at all can be found. If -E is given and no cartridge number is supplied at all, all hosts in this list are tried one after the other. The hostnames in this list can be separated by whitespace and/or commas

-I <idx-prefix>
    The first part of the filename, the names of the stored files and directories are written to. The current total backup number is appended (that increments each start of a full backup). If these files undergo compression, .z is appended

-k <file>
    Use the contents of the given file as encryption key for authenticating to the server

-l  do not restore anything, just list the names of the files and/or directories, that fit the supplied path-part(s); in combination with -E: just scan the given tape(s) and printout the minimum restore info, that can be read by restore -e

-n  do not restore anything, just printout a message, how many files and/or directories fit the supplied path-part(s); in combination with -E: just scan the given tape(s) and printout, what backups have been written there

-P <portnos>
    The list of port numbers for the backup servers either configured in the parameter file or supplied with the -h option. This list is used only, if no port number information can be found as associated with the actual filesystem entry, that should be restored. The port numbers supplied here are associated with the backup server names by position. The port numbers in this list can be separated by whitespace and/or commas

-V <var-dir>
    The directory, where varying files are put

-z <zipcmd> <unzipcmd>
    The commands to use for compress and uncompress. If a command comprises of several words, it must be put in quotes

I suggest to run restore with the -l option before really going to restore anything. So you see, what files will be generated, without overwriting existing ones unintendedly.

FILES

@clientlibdir@/@clientconf@
    Client configuration file

@clientlogdir@
    The directory for logging the client backups

@clientvardir@
    Some internal state information of the client backups.

SEE ALSO
afclientconfig(8), xafclientconfig(8), full_backup(8), incr_backup(8), afverify(8), afrestore(8), print_errors(8), afclient.conf(8), afserver.conf(8), tar(1)

AUTHOR
afbackup was written by Albert Fluegel (af@muc.de).