doc
csync_propagate.h
Go to the documentation of this file.
1/*
2 * libcsync -- a library to sync a directory with another
3 *
4 * Copyright (c) 2008-2013 by Andreas Schneider <asn@cryptomilk.org>
5 * Copyright (c) 2012-2013 by Klaas Freitag <freitag@owncloud.com>wie
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef _CSYNC_PROPAGATE_H
23#define _CSYNC_PROPAGATE_H
24
25#include <sys/types.h>
26
27/**
28 * @file csync_reconcile.h
29 *
30 * @brief Propagation
31 *
32 * It uses the calculated records to apply them on the current replica. The
33 * propagator uses a two-phase-commit mechanism to simulate an atomic
34 * filesystem operation.
35 *
36 * In the first phase we copy the file to a temporary file on the opposite
37 * replica. This has the advantage that we can check if file which has been
38 * copied to the opposite replica has been transfered successfully. If the
39 * connection gets interrupted during the transfer we still have the original
40 * states of the file. This means no data will be lost.
41 *
42 * In the second phase the file on the opposite replica will be overwritten by
43 * the temporary file.
44 *
45 * After a successful propagation we have to merge the trees to reflect the
46 * current state of the filesystem tree. This updated tree will be written as a
47 * journal into the state database. It will be used during the update detection
48 * of the next synchronization. See above for a description of the state
49 * database during synchronization.
50 *
51 * @defgroup csyncPropagationInternals csync propagation internals
52 * @ingroup csyncInternalAPI
53 *
54 * @{
55 */
56
57#define C_FILE_MODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
58#define C_DIR_MODE (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)
59
60/**
61 * @brief Propagate all files.
62 *
63 * @param ctx The csync context to use for propagation.
64 *
65 * @return 0 on success, < 0 on error.
66 */
68
69/**
70 * @brief Initialize the data base for overall progress information.
71 *
72 * @param ctx The csync context to use for propagation.
73 *
74 * @return 0 on success, < 0 on error.
75 */
77
78/**
79 * }@
80 */
81#endif /* _CSYNC_PROPAGATE_H */
82
83/* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */
int csync_propagate_files(CSYNC *ctx)
Propagate all files.
int csync_init_overall_progress(CSYNC *ctx)
Initialize the data base for overall progress information.
csync public structure