af supports some command line options. Most of them have only an effect for the create operation.
rm, rmdir(see mirror mode below), which is cleared by setting
The following options are implemented to support calling af from within scripts.
For example, af uses these options for the copy operation when creating backup archives for mirror destinations.
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:
archiveis the default operation mode: files are added to the archive but never deleted or modified. If
mirrortype is selected files are copied, overwritten or deleted from the destination as the source changes.
mirror mode offers two options that control how af deals with
operations modifying mirrored files:
: +backup (-copy dir | cmd [arg ...])
creates backups of all files that are going to be overwritten or
-copy dir af creates a standard archive in
dir, which receives the files. If dir does not start with a
/ 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
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
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
command line switch).
rmdir. The default is
rm,rmdirwhich 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.