User's manual. Section 1.

ZXREPL(1): create a file tree replica configuration


USAGE

        usage: zxrepl [-Dmnuv] {-x arg} [file [ldir rdir]]
            -D: debug
            -m: move existing replica client/server paths and/or add excludes
            -n: print just replica names when used to list replicas
            -u: don't use unix out
            -v: verbose
            -x: exclude
        

DESCRIPTION

Without arguments, zxrepl lists replicas found at /u/lib/repl.

With one argument (naming a replica), zxrepl lists the replica paths. Databases are printed if verbose is set.

With three arguments Zxrepl creates the databases for a replica. The replica consists on a local file tree and a remote one. The remote is usually a single tree at the server and local replicas synchronize with the remote. Zxrepl does not perform any synchronization. See the example.

The file argument names the replica and the database files. The replica is the basename for file. The local database file is file with ".ldb" appended. The remote database file is file with ".rdb" appended. If file does not contain "/" then "/u/lib/repl/" is prepended to it.

Arguments to -x are expressions to exclude files. If the expression starts with "/" it is matched against paths relative to the root of the replicated tree. Otherwise, the expression is matched against all components in the path and the file is excluded if there is a match.

Under flag -m, paths for local and remote trees are updated without making any other change in the databases, and any given exclude is added to existing excludes. This can be used after a replicated tree has moved to a different location and also to add new excludes.

Metadata changes at the root of the replica are always ignored.

EXAMPLE

Make a replica for the clive source excluding ZX attribute files and Git directories.

        ;  zxrepl -v -x .git -x .zx clive \
            /u/gosrc/src/clive \
            'tcp!fs.lsub.org!zx!lsub!/sys/src/clive'
        

Now make the local tree identical to the remote one (overwriting any local file):

        ; zxpull -va clive
        

After making changes, see which changes will be synchronized:

        ; zxsync -nv clive
        

And synchronize them:

        ; zxsync -v clive
        

List existing replicas:

        ; zxrepl
        

Update the replica databases to reflect new (local or remote) paths for for the replicated tree and to add a new exclude:

        ;  zxrepl -m -x objdir clive \
            /u/gosrc/src/clive \
            'tcp!fs.lsub.org!zx!lsub!/newdir/clive'
        

SOURCE

  • /zx/sys/src/clive/cmd/zxrepl

SEE ALSO


User's manual. Section 1.