EnglishFrenchSpanish

OnWorks favicon

fssync - Online in the Cloud

Run fssync in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command fssync that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


fssync - File system synchronization tool (1-way, over SSH)

SYNOPSIS


fssync -d db -r root [option...] host

DESCRIPTION


fssync is a 1-way file-synchronization tool that tracks inodes and maintains a local
database of files that are on the remote side, making it able to:

· handle efficiently a huge number of dirs/files

· detect renames/moves and hard-links

It aims at minimizing network traffic and synchronizing every detail of a file system:

· all types of inode: file, dir, block/character/fifo, socket, symlink

· preserve hard links

· modification time, ownership/permission/ACL, extended attributes

· sparse files

Other features:

· it can be configured to exclude files from synchronization

· fssync can be interrupted and resumed at any time, making it tolerant to random failures
(e.g. network error)

· algorithm to synchronize file content is designed to handle big files like VM images
efficiently, by updating fixed-size modified blocks in-place

Main usage of fssync is to prevent data loss in case of hardware failure, where RAID1 is
not possible (e.g. in laptops).

On Btrfs [1] file systems, fssync is an useful alternative to btrfs send (and receive)
commands, thanks to filtering capabilities. This can be combined with Btrfs snapshotting
at destination side for a full backup solution.

USAGE


Use fssync --help to get the complete list of options.

The most important thing to remember is that the local database must match exactly what's
on the destination host:

· Files that are copied on the destination host must not be modified. And nothing should
be manually created inside destination directories. If you still want to access data on
remote host, you should do it through a read-only bind mounts (requires Linux >=
2.6.26).

· You must have 1 database per destination, if you plan to have several copies of the same
source directory.

Look at -c option if you wonder whether your database matches the destination directory.

First run of fssync:

· The easiest way is to let fssync do everything. Specify a non-existing file path to -d
option and a empty or non-existing destination directory (see -R option). fssync will
automatically creates the database and copy all dirs/files to remote host.

· A faster way may be to do the initial copy by other means, like a raw copy of a
partition. If you're absolutely sure the source and destination are exactly the same,
you can initialize the database by specifying - as host. If inode numbers are the same
on both sides, which is the case if data were copied at block level, you can modify the
source partition while you are initializing the DB on the destination one, and get back
the DB locally.

An example of wrapper around fssync, with a filter, can be found at examples/fssync_home

fssync does never descend directories on other filesystems. Inodes masked by mount points
are also skipped, so they should be unmounted temporarily if you want them to be
synchronized. The same result can be achieved by synchronizing from a bind mount.

See also the NONE cipher switching [2] patch if you don't need encryption and you want to
speed up your SSH connection.

HOW IT WORKS


fssync maintains a single SQLite table of all dirs/files that are on the remote side. Each
row matches a path, with its inode (on local side), other metadata (on remote side) and a
checked flag.

When running, fssync iterates recursively through all local dirs/files and for each path
that is not ignored (see -f option), it queries the DB to decide what to do. If already
checked, path is skipped immediately. When a path is synchronized, it is marked as
checked. At the end, all rows that are not checked corresponds to paths that don't exist
anymore. Once they are deleted on the remote side, all checked flags are reset.

Failure tolerance
In fact, fssync doesn't require that the database matches perfectly the destination. It
tolerates some differences in order to recover any interrupted synchronization caused by a
network failure, a file operation error, or anything other than an operating system crash
of the local host (or something similar like a power failure).

In most cases, this is done by the remote host, which automatically create (or overwrite)
an inode of the expected type if necessary. The only exception is that the remote will
never delete a non-empty directory on its own. For most complex cases, fssync journalizes
the operation in the database: in case of failure, fssync will be able to recover on next
sync.

Race conditions
A race condition means that other processes on the local host are modifying inodes that
fssync is synchronizing. fssync handles any kind of race condition. In fact, fssync has
nothing to do for most cases.

When a race condition happens, fssync does not guarantee that the remote data is in a
consistent state. Each sync always fixes existing inconsistencies but may introduces
others, so fssync is not suitable for hot backuping of databases.

With Btrfs, you can get consistency by snapshotting at source side.

SIMILAR PROJECTS


The idea of maintaining a local database actually comes from csync2 [3]. I was about to
adopt it when I realized that I really needed a tool that always detects renames/moves of
big files. That's why I see fssync as a partial rewrite of csync2, with inode tracking and
without bidirectional synchronization. The local database really makes fssync & csync2
faster than the well-known rsync [4].

Use fssync online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Psi
    Psi
    Psi is cross-platform powerful XMPP
    client designed for experienced users.
    There are builds available for MS
    Windows, GNU/Linux and macOS.. Audience:
    End Users...
    Download Psi
  • 2
    Blobby Volley 2
    Blobby Volley 2
    Official continuation of the famous
    Blobby Volley 1.x arcade game..
    Audience: End Users/Desktop. User
    interface: OpenGL, SDL. Programming
    Language: C++, Lua. C...
    Download Blobby Volley 2
  • 3
    SuiteCRM
    SuiteCRM
    SuiteCRM is the award-winning Customer
    Relationship Management (CRM)
    application brought to you by authors
    and maintainers, SalesAgility. It is the
    world�s mos...
    Download SuiteCRM
  • 4
    Poweradmin
    Poweradmin
    Poweradmin is a web-based DNS
    administration tool for PowerDNS server.
    The interface has full support for most
    of the features of PowerDNS. It has full
    support...
    Download Poweradmin
  • 5
    Gin Web Framework
    Gin Web Framework
    Gin is an incredibly fast web framework
    written in Golang that can perform up to
    40 times faster, thanks to its
    martini-like API and custom version of
    httprout...
    Download Gin Web Framework
  • 6
    CEREUS LINUX
    CEREUS LINUX
    CEREUS LINUX basado en MX LINUX con
    varios entornos de escritorios. This is
    an application that can also be fetched
    from
    https://sourceforge.net/projects/cereu...
    Download CEREUS LINUX
  • More »

Linux commands

  • 1
    aa-clickquery
    aa-clickquery
    aa-clickquery - program for querying
    click-apparmor DESCRIPTION: This program
    is used to query click-apparmor for
    information. USAGE: aa-clickquery
    --click-fra...
    Run aa-clickquery
  • 2
    aa-exec-click
    aa-exec-click
    aa-exec-click - program for executing
    click packages under confinement
    DESCRIPTION: This program is used to
    execute click package under AppArmor
    confinement. I...
    Run aa-exec-click
  • 3
    cpio
    cpio
    cpio - copy files to and from archives ...
    Run cpio
  • 4
    cpipe
    cpipe
    cpipe - copy stdin to stdout while
    counting bytes and reporting progress ...
    Run cpipe
  • 5
    FvwmSave
    FvwmSave
    FvwmSave - the Fvwm desktop-layout
    saving module ...
    Run FvwmSave
  • 6
    FvwmSave1
    FvwmSave1
    FvwmSave - the FVWM desktop-layout
    saving module ...
    Run FvwmSave1
  • More »

Ad