filesync(4)

NAME
filesync rules file format

SYNOPSIS
$HOME/.filesync-rules

DESCRIPTION
The filesync rules file records the names of all of the files that are to be kept in sync with the filesync command. Many users will use the filesync command to maintain these rules, but some users may prefer to edit this file directly in order to gain access to more powerful options that are not available from the command line.

Blank lines and lines that begin with a sharp sign ``#'' are ignored.

Any line can be continued by placing a backslash ``\'' immediately before the newline.

All other lines have one of the following forms:

BASE directory-1 directory-2
    identifies a pair of directories, under which files will be kept in sync. The arguments must be fully qualified path names, and may include environment variables.

LIST name ...
    enumerates a list of files and sub-directories (beneath the current BASE) that are to be kept in sync. This specification is recursive, in that specifying the name of a directory automatically includes all files and subdirectories it contains. Regular expressions (ala glob/gmatch) are permitted.

IGNORE name ...
    enumerates a list of files that are not to be kept in sync. Regular expressions (ala glob/gmatch) are permitted.

If the first name argument to a LIST statement begins with an exclaimation point ``!'', the remainder of the statement will be executed as a command. The command will be run in the current BASE directory. The output of the command will be treated as a list of newline separated file names to be synchronized.

If the first name argument to an IGNORE statement begins with an exclaimation point ``!'', the remainder of the statemetn will be executed as a command. The command will be run in the current BASE directory. The command will be passed a list of newline separated file names as input. The command will be expected to figure out which names should not be synchronized. The output of the command will be treated as a list of newline separated file names that should not be kept synchonized.

Commands will be broken into distinct arguments and run directly with sh -c. Blanks can be embedded in an argument by escaping them (with a backslash) or enclosing the argument in double-quote ``"'' characters. Double quotes can be passed in arguments by escaping them (with a backslash).

LIST lines only apply to the BASE statement that preceeds them. IGNORE lines can appear before any BASE statement (in which case they apply to all BASEs) or after a BASE statement (in which case they only apply to the BASE that preceeds them). Any number of these statements can ocurr in any combination, and they are evaluated in order (i.e. later statements augment or modify prior statements). Global IGNORE statements are applied after all statements associated with a particular BASE.

The use of these statements is illustrated in the following example:
    #
    # junk files, not worth copying
    #
    IGNORE core *.o *.bak *%
    #
    # most of the stuff I want to keep in sync is in my $HOME
    #
    BASE /net/bigserver/export/home/myname $HOME
    # everything in my work sub-directory should be maintained
    LIST work
    # a few of my favorite mail boxes should be replicated
    LIST m/incoming
    LIST m/action
    LIST m/pending
    #
    # I like to carry around a couple of project directories
    # but skip all the postscript output
    #
    BASE /net/bigserver/export/projects $HOME/projects
    LIST poindexter epiphany
    IGNORE *.ps
    #
    # and the latest executables for the standard build environment
    #
    BASE /net/bigserver/export/buildenv $HOME/buildenv
    LIST !find . -type f -a -perm -111 -a -print

SEE ALSO
filesync(1)