Install
Install on the server and on every client. The server runs
filesync-admin and filesync-server; the clients run
filesync. One installation provides all three programs.
From CPAN
cpanm App::FileSync
Or with the traditional client:
perl -MCPAN -e 'install App::FileSync'
From source
tar xzf App-FileSync-0.002.0.tar.gz
cd App-FileSync-0.002.0
perl Makefile.PL
make
make test
make install
make install may need root, or a PERL_MM_OPT/
local::lib prefix. If you install into a per-user directory,
remember that cron's PATH rarely includes it: name the full path
in the crontab, as the quick start does.
Requirements
Perl 5.14 or later. Most of what the distribution uses ships with Perl; the non-core prerequisites are:
| Module | Minimum | Why |
|---|---|---|
Config::Abstraction | 0.41 | explain_sources(), used by filesync settings |
Log::Abstraction | 0.36 | structured fields in the run log |
Params::Validate::Strict | 0.41 | argument validation at public entry points |
Params::Get | 0.17 | named and positional argument handling |
Object::Configure | — | layered process settings |
Readonly | 2.05 | constants |
Sub::Private | 0.07 | private methods in enforce mode |
Sub::Protected | 0.03 | protected methods in the base class |
IPC::System::Simple | 1.30 | running ssh |
Compress::Raw::Zlib | — | deflating data frames |
Digest::SHA | — | content hashes and transfer verification |
JSON::PP | — | configuration, manifests and the wire protocol |
autodie | 2.37 | file operations |
List::Util | 1.54 | list helpers |
version | 0.77 | dotted version objects |
The rest — Carp, Cwd, Exporter,
Fcntl, File::Basename, File::Copy,
File::Path, File::Spec, File::Temp,
FindBin, Getopt::Long, IO::Handle,
IPC::Open3, Scalar::Util, Sys::Hostname,
Time::HiRes and Time::Local — ships with
Perl.
The two version minimums are deliberate. Config::Abstraction
0.41 added explain_sources(), and Log::Abstraction
0.36 added the structured fields the client writes its run summary with. An
older copy of either used to satisfy the installer and then misbehave at run
time, so both are now declared.
Platforms
- Linux and other Unix systems. The usual target. Cron starts the client; ssh carries the session.
- macOS. Works as a client, and as a server over ssh.
The distribution builds its tarball with
gtarthere. - Windows. Use Strawberry Perl and the Task Scheduler. On Perl 5.42 the plain-Perl end-of-scope hook is selected automatically, so nothing has to be set in the environment to build or run the tools.
Check the installation
filesync version
perldoc App::FileSync
filesync version prints the release. If the command is not
found, the installation directory is not on PATH; use the full
path, or add it to the PATH the scheduler sees.
Upgrading
Install the newer release the same way. The client configuration, the server's repo metadata and the on-disk index are read as they are; unknown keys are kept and ignored. Peers speak the line-delimited JSON protocol, so upgrade the server before, or together with, the clients.
Trash written by releases before 0.001.1 sits in one shared directory.
filesync restore still searches it, so files trashed before an
upgrade can still be recovered.