Removed the csync documentation as it is not longer used here.
|
@ -47,7 +47,6 @@ endif (MEM_NULL_TESTS)
|
|||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(config)
|
||||
add_subdirectory(csync_doc)
|
||||
|
||||
if (CMOCKA_FOUND AND UNIT_TESTING)
|
||||
add_subdirectory(tests)
|
||||
|
|
|
@ -1,41 +0,0 @@
|
|||
project(csync_doc C)
|
||||
# Build the documentation
|
||||
#
|
||||
|
||||
include(UseDoxygen OPTIONAL)
|
||||
|
||||
file(GLOB _manpages *.[0-9].txt)
|
||||
add_custom_target(man
|
||||
COMMAND
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/makeman.sh ${_manpages}
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(userguide
|
||||
COMMAND
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/makeguide.sh ocsync.txt
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
if (UNIX)
|
||||
install(
|
||||
FILES
|
||||
ocsync.1
|
||||
DESTINATION
|
||||
${MAN_INSTALL_DIR}/man1
|
||||
)
|
||||
set(DOC_INSTALL_PATH ${SHARE_INSTALL_PREFIX}/doc/ocsync)
|
||||
endif(UNIX)
|
||||
|
||||
if (WIN32)
|
||||
set(DOC_INSTALL_PATH ${SHARE_INSTALL_PREFIX}/doc)
|
||||
endif (WIN32)
|
||||
|
||||
install(
|
||||
DIRECTORY
|
||||
userguide
|
||||
DESTINATION
|
||||
${DOC_INSTALL_PATH}
|
||||
)
|
|
@ -1,8 +0,0 @@
|
|||
#
|
||||
# Customization for csync documentation.
|
||||
#
|
||||
[specialwords]
|
||||
ifndef::doctype-manpage[]
|
||||
emphasizedwords=(?u)\\?\bCSYNC\b
|
||||
monospacedwords=(?u)\\?\bcsync\(1\)
|
||||
endif::doctype-manpage[]
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* cynapses libc functions
|
||||
*
|
||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
||||
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
|
||||
* Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef _CSYNC_X_H
|
||||
#define _CSYNC_X_H
|
||||
|
||||
#endif /* _CSYNC_X_H */
|
||||
/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */
|
|
@ -1,16 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Last Change: 2008-07-03 11:08:54
|
||||
|
||||
for f in $@; do
|
||||
test "${f##*/}" = "CMakeLists.txt" && continue
|
||||
echo -e "\e[32mCreating asciidoc html document ${f%.*}.html\e[0m"
|
||||
asciidoc \
|
||||
--attribute=numbered \
|
||||
--attribute=icons \
|
||||
--attribute="iconsdir=./images/icons" \
|
||||
--attribute=toc \
|
||||
--backend=xhtml11 \
|
||||
--out-file="$(dirname $f)/userguide/${f%.*}.html" \
|
||||
$f
|
||||
rm -f ${f%.*}.xml
|
||||
done
|
|
@ -1,9 +0,0 @@
|
|||
#!/bin/bash
|
||||
# Last Change: 2008-07-03 11:08:54
|
||||
|
||||
for f in $@; do
|
||||
test "${f##*/}" = "CMakeLists.txt" && continue
|
||||
echo -e "\e[32mCreating manpage ${f%.*}\e[0m"
|
||||
a2x --doctype=manpage --format=manpage $f
|
||||
rm -f ${f%.*}.xml
|
||||
done
|
|
@ -1,183 +0,0 @@
|
|||
'\" t
|
||||
.\" Title: ocsync
|
||||
.\" Author: [see the "AUTHORS" section]
|
||||
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
||||
.\" Date: 12/22/2012
|
||||
.\" Manual: \ \&
|
||||
.\" Source: \ \&
|
||||
.\" Language: English
|
||||
.\"
|
||||
.TH "OCSYNC" "1" "12/22/2012" "\ \&" "\ \&"
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * Define some portability stuff
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.\" http://bugs.debian.org/507673
|
||||
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
||||
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.ie \n(.g .ds Aq \(aq
|
||||
.el .ds Aq '
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * set default formatting
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" disable hyphenation
|
||||
.nh
|
||||
.\" disable justification (adjust text to left margin only)
|
||||
.ad l
|
||||
.\" -----------------------------------------------------------------
|
||||
.\" * MAIN CONTENT STARTS HERE *
|
||||
.\" -----------------------------------------------------------------
|
||||
.SH "NAME"
|
||||
ocsync \- A commandline frontent for csync a user level bidirectional file synchronizer\&.
|
||||
.SH "SYNOPSIS"
|
||||
.sp
|
||||
\fBocsync\fR [\fIOPTION\fR\&...] \fISOURCE\fR \fIDESTINATION\fR
|
||||
.SH "DESCRIPTION"
|
||||
.sp
|
||||
ocsync is a client only bidirectional file synchronizer\&. It synchronizes the content of \fISOURCE\fR with \fIDESTINATION\fR and vice versa\&. The \fIDESTINATION\fR can be a local directory or a remote file server\&.
|
||||
.sp
|
||||
You can use ocsync for different things\&. The intention is to provide Roaming Home Directories for Linux but you can use it to synchronize your music collection or create a backup of a directory\&.
|
||||
.SH "OPTIONS"
|
||||
.PP
|
||||
\fB\-\-create\-statedb\fR
|
||||
.RS 4
|
||||
Run update detection and write the statedb (TESTING ONLY!)
|
||||
.RE
|
||||
.PP
|
||||
\fB\-d, \-\-disable\-statedb\fR
|
||||
.RS 4
|
||||
Disable the usage and creation of a statedb\&.
|
||||
.RE
|
||||
.PP
|
||||
\fB\-\-exclude\-file=\fR\fB\fI<file>\fR\fR
|
||||
.RS 4
|
||||
Add an additional exclude file
|
||||
.RE
|
||||
.PP
|
||||
\fB\-r, \-\-reconcile\fR
|
||||
.RS 4
|
||||
Run ONLY update detection and reconcilation This option is for debugging
|
||||
.RE
|
||||
.PP
|
||||
\fB\-u, \-\-update\fR
|
||||
.RS 4
|
||||
Run ONLY the update detection This option is for debugging
|
||||
.RE
|
||||
.PP
|
||||
\fB\-?, \-\-help\fR
|
||||
.RS 4
|
||||
Print the help list
|
||||
.RE
|
||||
.PP
|
||||
\fB\-V, \-\-version\fR
|
||||
.RS 4
|
||||
Print program version
|
||||
.RE
|
||||
.SH "EXIT STATUS"
|
||||
.PP
|
||||
\fB0\fR
|
||||
.RS 4
|
||||
Success
|
||||
.RE
|
||||
.PP
|
||||
\fB1\fR
|
||||
.RS 4
|
||||
Failure (syntax or usage error; configuration error; unexpected error)\&.
|
||||
.RE
|
||||
.SH "EXAMPLES"
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
ocsync /home/user /backup/home/user
|
||||
.sp
|
||||
.if n \{\
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
Synchronizer two local directories\&.
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
.\}
|
||||
.RE
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
ocsync /home/user smb://server/share/user
|
||||
.sp
|
||||
.if n \{\
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
Synchronize a home directory with a SMB share\&.
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
.\}
|
||||
.RE
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
ocsync /home/user smb://user:password@server/share/user
|
||||
.sp
|
||||
.if n \{\
|
||||
.RS 4
|
||||
.\}
|
||||
.nf
|
||||
Synchronize a home directory with a SMB share and provide username and
|
||||
password directly\&.
|
||||
.fi
|
||||
.if n \{\
|
||||
.RE
|
||||
.\}
|
||||
.RE
|
||||
.SH "BUGS"
|
||||
.sp
|
||||
Please report bugs at https://dev\&.csync\&.org/\&.
|
||||
.SH "SEE ALSO"
|
||||
.sp
|
||||
\fBlibocsync\fR(7)
|
||||
.SH "AUTHORS"
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
Andreas Schneider <mail@cynapses\&.org>
|
||||
.RE
|
||||
.sp
|
||||
.RS 4
|
||||
.ie n \{\
|
||||
\h'-04'\(bu\h'+03'\c
|
||||
.\}
|
||||
.el \{\
|
||||
.sp -1
|
||||
.IP \(bu 2.3
|
||||
.\}
|
||||
Klaas Freitag <freitag@owncloud\&.com>
|
||||
.RE
|
||||
.SH "COPYING"
|
||||
.sp
|
||||
Copyright \e(c) 2006\-2008 Andreas Schneider\&. Free use of this software is granted under the terms of the GNU General Public License (GPL)\&.
|
|
@ -1,103 +0,0 @@
|
|||
ocsync(1)
|
||||
========
|
||||
|
||||
NAME
|
||||
----
|
||||
|
||||
ocsync - A commandline frontent for csync a user level bidirectional file
|
||||
synchronizer.
|
||||
|
||||
|
||||
SYNOPSIS
|
||||
--------
|
||||
|
||||
*ocsync* ['OPTION'...] 'SOURCE' 'DESTINATION'
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
-----------
|
||||
|
||||
ocsync is a client only bidirectional file synchronizer. It synchronizes the
|
||||
content of 'SOURCE' with 'DESTINATION' and vice versa. The 'DESTINATION' can
|
||||
be a local directory or a remote file server.
|
||||
|
||||
You can use ocsync for different things. The intention is to provide Roaming
|
||||
Home Directories for Linux but you can use it to synchronize your music
|
||||
collection or create a backup of a directory.
|
||||
|
||||
|
||||
OPTIONS
|
||||
-------
|
||||
|
||||
*--create-statedb*::
|
||||
Run update detection and write the statedb
|
||||
(TESTING ONLY!)
|
||||
*-d, --disable-statedb*::
|
||||
Disable the usage and creation of a statedb.
|
||||
|
||||
*--exclude-file='<file>'*::
|
||||
Add an additional exclude file
|
||||
|
||||
*-r, --reconcile*::
|
||||
Run ONLY update detection and reconcilation
|
||||
This option is for debugging
|
||||
|
||||
*-u, --update*::
|
||||
Run ONLY the update detection
|
||||
This option is for debugging
|
||||
|
||||
*-?, --help*::
|
||||
Print the help list
|
||||
|
||||
*-V, --version*::
|
||||
Print program version
|
||||
|
||||
|
||||
EXIT STATUS
|
||||
-----------
|
||||
*0*::
|
||||
Success
|
||||
|
||||
*1*::
|
||||
Failure (syntax or usage error; configuration error;
|
||||
unexpected error).
|
||||
|
||||
|
||||
EXAMPLES
|
||||
--------
|
||||
|
||||
* ocsync /home/user /backup/home/user
|
||||
|
||||
Synchronizer two local directories.
|
||||
|
||||
* ocsync /home/user smb://server/share/user
|
||||
|
||||
Synchronize a home directory with a SMB share.
|
||||
|
||||
* ocsync /home/user smb://user:password@server/share/user
|
||||
|
||||
Synchronize a home directory with a SMB share and provide username and
|
||||
password directly.
|
||||
|
||||
BUGS
|
||||
----
|
||||
|
||||
Please report bugs at https://dev.csync.org/.
|
||||
|
||||
|
||||
SEE ALSO
|
||||
--------
|
||||
|
||||
*libocsync*(7)
|
||||
|
||||
|
||||
AUTHORS
|
||||
-------
|
||||
|
||||
* Andreas Schneider <mail@cynapses.org>
|
||||
* Klaas Freitag <freitag@owncloud.com>
|
||||
|
||||
COPYING
|
||||
-------
|
||||
Copyright \(c) 2006-2008 Andreas Schneider. Free use of this software is
|
||||
granted under the terms of the GNU General Public License (GPL).
|
|
@ -1,315 +0,0 @@
|
|||
CSYNC User Guide
|
||||
================
|
||||
Andreas Schneider <asn@cryptomilk.org>
|
||||
:Author Initials: ADS
|
||||
|
||||
csync is a lightweight utility to synchronize files between two directories
|
||||
on a system or between multiple systems.
|
||||
|
||||
It synchronizes bidirectionally and allows the user to keep two copies of files
|
||||
and directories in sync. csync uses widely adopted protocols, such as smb or
|
||||
sftp, so that there is no need for a server component. It is a user-level
|
||||
program which means you don't need to be a superuser or administrator.
|
||||
|
||||
Together with a Pluggable Authentication Module (PAM), the intent is to provide
|
||||
Roaming Home Directories for Linux (see <<X80, The PAM Module>>).
|
||||
|
||||
Introduction
|
||||
------------
|
||||
|
||||
It is often the case that we have multiple copies (called replicas) of a
|
||||
filesystem or part of a filesystem (for example on a notebook and desktop
|
||||
computer). Changes to each replica are often made independently, and as a
|
||||
result, they do not contain the same information. In that case, a file
|
||||
synchronizer is used to make them consistent again, without losing any
|
||||
information.
|
||||
|
||||
The goal is to detect conflicting updates (files which have been modified) and
|
||||
propagate non-conflicting updates to each replica. If there are no conflicts
|
||||
left, we are done, and the replicas are identical. To resolve or handle
|
||||
conflicts there are several algorithms available. They will be discussed
|
||||
one of the following sections.
|
||||
|
||||
Basics
|
||||
------
|
||||
|
||||
This section describes some basics of file synchronization.
|
||||
|
||||
Paths
|
||||
~~~~~
|
||||
A path normally refers to a point which contains a set of files which should be
|
||||
synchronized. It is specified relative to the root of the replica locally, but
|
||||
has to be absolute if you use a protocol. The path is just a sequence of names
|
||||
separated by '/'.
|
||||
|
||||
NOTE: The path separator is always a forward slash '/', even for Windows.
|
||||
|
||||
csync always uses the absolute path on remote replicas. This could
|
||||
'sftp://gladiac:secret@myserver/home/gladiac' for sftp.
|
||||
|
||||
What is an update?
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
The contents of a path could be a file, a directory or a symbolic link
|
||||
(symbolic links are not supported yet). To be more precise, if the path refers
|
||||
to:
|
||||
|
||||
- a regular file: the contents of the file are the byte stream and the
|
||||
metadata of the file.
|
||||
- a directory: then the content is the metadata of the directory.
|
||||
- a symbolic link: the content is the named file the link points to.
|
||||
|
||||
csync keeps a record of each path which has been successfully synchronized. The
|
||||
path gets compared with the record and if it has changed since the last
|
||||
synchronization, we have an update. This is done by comparing the modification
|
||||
or change (modification time of the metadata) time. This is the way how updates
|
||||
are detected.
|
||||
|
||||
What is a conflict?
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
A path is conflicting if it fulfills the following conditions:
|
||||
|
||||
1. it has been updated in one replica,
|
||||
2. it or any of its descendants has been updated on the other replica too, and
|
||||
3. its contents in are not identical.
|
||||
|
||||
File Synchronization
|
||||
--------------------
|
||||
|
||||
The primary goal of the file synchronizer is correctness. It may change
|
||||
scattered or large parts of the filesystem. Since this in mostly not monitored
|
||||
by the user, and the file synchronizer is in a position to harm the system,
|
||||
csync must be safe, even in the case of unexpected errors (e.g. disk full).
|
||||
What was done to make csync safe is described in the following sections.
|
||||
|
||||
|
||||
One problem concerning correctness is the handling of conflicts. Each file
|
||||
synchronizer tries to propagate conflicting changes to the other replica. At
|
||||
the end both replicas should be identical. There are different strategies to
|
||||
fulfill these goals.
|
||||
|
||||
csync is a three-phase file synchronizer. The decision for this design was that
|
||||
user interaction should be possible and it should be easy to understand the
|
||||
process. The three phases are update detection, reconciliation and propagation.
|
||||
These will be described in the following sections.
|
||||
|
||||
Update detection
|
||||
~~~~~~~~~~~~~~~~
|
||||
There are different strategies for update detection. csync uses a state-based
|
||||
modtime-inode update detector. This means it uses the modification time to
|
||||
detect updates. It doesn't require many resources. A record of each file is
|
||||
stored in a database (called statedb) and compared with the current
|
||||
modification time during update detection. If the file has changed since the
|
||||
last synchronization an instruction is set to evaluate it during the
|
||||
reconciliation phase. If we don't have a record for a file we investigate, it
|
||||
is marked as new.
|
||||
|
||||
It can be difficult to detect renaming of files. This problem is also solved
|
||||
by the record we store in the statedb. If we don't find the file by the name
|
||||
in the database, we search for the inode number. If the inode number is found
|
||||
then the file has been renamed.
|
||||
|
||||
Reconciliation
|
||||
~~~~~~~~~~~~~~
|
||||
The most important component is the update detector, because the reconciler
|
||||
depends on it. The correctness of reconciler is mandatory because it can damage
|
||||
a filesystem. It decides which file:
|
||||
|
||||
* Stays untouched
|
||||
* Has a conflict
|
||||
* Gets synchronized
|
||||
* or is *deleted*
|
||||
|
||||
A wrong decision of the reconciler leads in most cases to a loss of data. So
|
||||
there are several conditions which a file synchronizer has to follow.
|
||||
|
||||
Algorithms
|
||||
^^^^^^^^^^
|
||||
|
||||
For conflict resolution several different algorithms could be implemented. The
|
||||
most common algorithms are the merge and the conflict algorithm. The first
|
||||
is a batch algorithm and the second is one which needs user interaction.
|
||||
|
||||
Merge algorithm
|
||||
+++++++++++++++
|
||||
|
||||
The merge algorithm is an algorithm which doesn't need any user interaction. It
|
||||
is simple and used for example by Microsoft for Roaming Profiles. If it detects
|
||||
a conflict (the same file changed on both replicas) then it will use the most
|
||||
recent file and overwrite the other. This means you can loose some data, but
|
||||
normally you want the latest file.
|
||||
|
||||
Conflict algorithm
|
||||
++++++++++++++++++
|
||||
|
||||
This is not implemented yet.
|
||||
|
||||
If a file has a conflict the user has to decide which file should be used.
|
||||
|
||||
Propagation
|
||||
~~~~~~~~~~~
|
||||
|
||||
The next instance of the file synchronizer is the propagator. It uses the
|
||||
calculated records to apply them on the current replica.
|
||||
|
||||
|
||||
The propagator uses a two-phase-commit mechanism to simulate an atomic
|
||||
filesystem operation.
|
||||
|
||||
In the first phase we copy the file to a temporary file on the opposite
|
||||
replica. This has the advantage that we can check if the file which has been
|
||||
copied to the opposite replica has been transferred successfully. If the
|
||||
connection gets interrupted during the transfer we still have the original
|
||||
states of the file. This means no data will be lost.
|
||||
|
||||
In the second phase the file on the opposite replica will be overwritten by
|
||||
the temporary file.
|
||||
|
||||
After a successful propagation we have to merge the trees to reflect the
|
||||
current state of the filesystem tree. This updated tree will be written as a
|
||||
journal into the state database. It will be used during the update detection of
|
||||
the next synchronization. See above for a description of the state database
|
||||
during synchronization.
|
||||
|
||||
Robustness
|
||||
~~~~~~~~~~
|
||||
|
||||
This is a very important topic. The file synchronizer should not crash, and if
|
||||
it has crashed, there should be no loss of data. To achieve this goal there are
|
||||
several mechanisms which will be discussed in the following sections.
|
||||
|
||||
Crash resistance
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
The synchronization process can be interrupted by different events, this can
|
||||
be:
|
||||
|
||||
* the system could be halted due to errors.
|
||||
* the disk could be full or the quota exceeded.
|
||||
* the network or power cable could be pulled out.
|
||||
* the user could force a stop of the synchronization process.
|
||||
* various communication errors could occur.
|
||||
|
||||
That no data will be lost due to an event we enforce the following invariant:
|
||||
|
||||
IMPORTANT: At every moment of the synchronization each file, has either its
|
||||
original content or its correct final content.
|
||||
|
||||
This means that the original content can not be incorrect, no data can be lost
|
||||
until we overwrite it after a successful synchronization. Therefore, each
|
||||
interrupted synchronization process is a partial sync and can be continued and
|
||||
completed by simply running csync again. The only problem could be an error of
|
||||
the filesystem, so we reach this invariant only approximately.
|
||||
|
||||
Transfer errors
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
With the Two-Phase-Commit we check the file size after the file has transferred
|
||||
and we are able to detect transfer errors. A more robust approach would be a
|
||||
transfer protocol with checksums, but this is not doable at the moment. We may
|
||||
add this in the future.
|
||||
|
||||
Future filesystems, like btrfs, will help to compare checksums instead of the
|
||||
filesize. This will make the synchronization safer. This does not imply that it
|
||||
is unsafe now, but checksums are safer than simple filesize checks.
|
||||
|
||||
Database loss
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
It is possible that the state database could get corrupted. If this happens,
|
||||
all files get evaluated. In this case the file synchronizer wont delete any
|
||||
file, but it could occur that deleted files will be restored from the other
|
||||
replica.
|
||||
|
||||
To prevent a corruption or loss of the database if an error occurs or the user
|
||||
forces an abort, the synchronizer is working on a copy of the database and will
|
||||
use a Two-Phase-Commit to save it at the end.
|
||||
|
||||
Getting started
|
||||
---------------
|
||||
|
||||
Installing csync
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
See the `README` and `INSTALL` files for install prerequisites and
|
||||
procedures. Packagers should take a look at <<X90, Appendix A: Packager Notes>>.
|
||||
|
||||
Using the commandline client
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The synopsis of the commandline client is
|
||||
|
||||
csync [OPTION...] SOURCE DESTINATION
|
||||
|
||||
It synchronizes the content of SOURCE with DESTINATION and vice versa. The
|
||||
DESTINATION can be a local directory or a remote file server.
|
||||
|
||||
csync /home/csync scheme://user:password@server:port/full/path
|
||||
|
||||
Examples
|
||||
^^^^^^^^
|
||||
|
||||
To synchronize two local directories:
|
||||
|
||||
csync /home/csync/replica1 /home/csync/relplica2
|
||||
|
||||
Two synchronizer a local directory with an smb server, use
|
||||
|
||||
csync /home/csync smb://rupert.galaxy.site/Users/csync
|
||||
|
||||
If you use kerberos, you don't have to specify a username or a password. If you
|
||||
don't use kerberos, the commandline client will ask about the user and the
|
||||
password. If you don't want to be prompted, you can specify it on the
|
||||
commandline:
|
||||
|
||||
csync /home/csync smb://csync:secret@rupert.galaxy.site/Users/csync
|
||||
|
||||
If you use the sftp protocol and want to specify a port, you do it the
|
||||
following way:
|
||||
|
||||
csync /home/csync sftp://csync@krikkit.galaxy.site:2222/home/csync
|
||||
|
||||
The remote destination is supported by plugins. By default csync ships with smb
|
||||
and sftp support. For more information, see the manpage of csync(1).
|
||||
|
||||
Exclude lists
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
csync provides exclude lists with simple shell wildcard patterns. There is a
|
||||
global exclude list, which is normally located in
|
||||
'/etc/csync/csync_exclude.conf' and it has already some sane defaults. If you
|
||||
run csync the first time, it will create an empty exclude list for the user.
|
||||
This file will be '~/.csync/csync_exclude.conf'. csync considers both
|
||||
configuration files and an additional one if you specify it.
|
||||
|
||||
The entries in the file are newline separated. Use
|
||||
'/etc/csync/csync_exclude.conf' as an example.
|
||||
|
||||
Debug messages and dry run
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
By default the csync client logs to stderr and you can increase the debug
|
||||
level with a commandline options.
|
||||
|
||||
To simulate a run of the file synchronizer, you should set the priority to
|
||||
'debug' for the categories 'csync.updater' and 'csync.reconciler' in the config
|
||||
file '~/.csync/csync_log.conf'. Then run csync with the '--dry-run' option.
|
||||
This will only run update detection and reconciliation.
|
||||
|
||||
[[X80]]
|
||||
The PAM module
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
pam_csync is a PAM module to provide roaming home directories for a user
|
||||
session. This module is aimed at environments with central file servers where a
|
||||
user wishes to store his home directory. The Authentication Module verifies the
|
||||
identity of a user and triggers a synchronization with the server on the first
|
||||
login and the last logout. More information can be found in the manpage of the
|
||||
module pam_csync(8) or pam itself pam(8).
|
||||
|
||||
|
||||
[[X90]]
|
||||
Appendix A: Packager Notes
|
||||
--------------------------
|
||||
|
||||
Read the `README`, `INSTALL` and `FAQ` files (in the distribution root
|
||||
directory).
|
|
@ -1,5 +0,0 @@
|
|||
Replaced the plain DocBook XSL admonition icons with Jimmac's DocBook
|
||||
icons (http://jimmac.musichall.cz/ikony.php3). I dropped transparency
|
||||
from the Jimmac icons to get round MS IE and FOP PNG incompatibilies.
|
||||
|
||||
Stuart Rackham
|
Before Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 361 B |
Before Width: | Height: | Size: 565 B |
Before Width: | Height: | Size: 617 B |
Before Width: | Height: | Size: 623 B |
Before Width: | Height: | Size: 411 B |
Before Width: | Height: | Size: 640 B |
Before Width: | Height: | Size: 353 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 345 B |
Before Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 355 B |
Before Width: | Height: | Size: 344 B |
Before Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 357 B |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 2.8 KiB |