Last modified: 2021-09-09 16:52

af Options

af command line options

af supports some command line options. Most of them have only an effect for the create operation.

copies all files, not only those which are changed.

create a new volume if no file has changed (and the volume will be empty).

-f fn
reads configuration from fn not .archive.conf.

-k cmdlist
defines a comma separated list of shell commands for which execution errors are ignored. The default is rm, rmdir (see mirror mode below), which is cleared by setting -.

-n label
adds label to the volume's directory name.

doesn't print the list of modified files.

The following options are implemented to support calling af from within scripts.

-D dir
sets the destination directory.

-H text
sets the history comment.

-S dir
add dir as source location.

For example, af uses these options for the copy operation when creating backup archives for mirror destinations.

Mirror mode

af's default operation mode is to create archives: new files are added into separate directories but files are never overwritten or removed. Depending on the application a mirror of files can be helpful, perhaps in its own configuration section. Examples could be

Use the type configuration option to make a destination a mirror:

type archive|mirror
defines the destination type. archive is the default operation mode: files are added to the archive but never deleted or modified. If mirror type is selected files are copied, overwritten or deleted from the destination as the source changes.

The mirror mode offers two options that control how af deals with operations modifying mirrored files:

ignores all operations that would delete files or directories. Files will be still deleted if removed from the source.

: +backup (-copy dir | cmd [arg ...]) creates backups of all files that are going to be overwritten or deleted. With -copy dir af creates a standard archive in dir, which receives the files. If dir does not start with a slash / dir is relative to the destination's location and must exist. If instead cmd is configured the program is started by af and receives the files to backup on its stdin. cmd must return exit-code 0 to signal success. If cmd fails the create operation aborts. (For -copy af creates a command line for another instance of af, which behaves like this.)

Depending on the use of the mirror delete operations during af create may fail because e.g.

af's default is to ignore errors from this operations because it does not affect copying the files to the destination. This behaviour can be changed with the accept-errors option (or -k cmdlist command line switch).

accept-errors cmdlist
defines a comma-separated list of operations for which errors are ignored. Possible values are: cp, mkdir rm and rmdir. The default is rm,rmdir which is cleared with a value of -.

Notice that for remote destinations files are copied first to the computer running af and then back to the remote host in order to create the backups.