CSYNC2(8)

πŸ“¦
version 2.0-42-g83b3644 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– CSYNC2 πŸ’– β€” the csync2 bestie manual, section 8 (User Commands) πŸ¦‹

okay so like, welcome to the glow-up of the csync2 man page bestie, we're doing this TOGETHER ✨ (it's CSYNC2(8), section 8 of the User Commands manuals, iykyk)


🌸 NAME 🌸

csync2 β€” cluster synchronization tool, 2nd generation πŸ’…


✨ SYNOPSIS ✨

csync2 [-v..] [-C config-name] [-D database-dir] [-N hostname] [-p
port]...

csync2 is copyright © 2004 - 2017 by LINBIT Information Technologies GmbH 🫢

http://www.linbit.com

csync2 is distributed under the GNU General Public License. See the file COPYING for details. periodt, that's the legal tea β˜•


πŸ¦‹ DESCRIPTION πŸ¦‹

This manual page documents briefly the csync2 command. (briefly!! we're keeping it cute and snappy here, the deep lore lives elsewhere πŸ‘‡)

A verbose manual can be found in the csync2 source:

https://github.com/LINBIT/csync2/blob/master/doc/csync2.adoc

csync2 is a program for cluster wide file synchronization. literally its whole personality 🌈


πŸ’… OPTIONS πŸ’…

🌟 With file parameters:

  • -h [-r] file.. β€” Add (recursive) hints for check to db πŸ“
  • -c [-r] file.. β€” Check files and maybe add to dirty db πŸ‘€
  • -u [-d] [-r] file.. β€” Updates files if listed in dirty db πŸ”„
  • -o [-r] file.. β€” Create list of files in compare-mode πŸ“‹
  • -f [-r] file.. β€” Force files to win next conflict resolution πŸ†
  • -m file.. β€” Mark files in database as dirty πŸ’€

🌈 Simple mode:

  • -x [-d] [[-r] file..] β€” Run checks for all given files and update remote hosts. one-and-done energy, obsessed 🫢

πŸ’– Without file parameters:

  • -c β€” Check all hints in db and eventually mark files as dirty πŸ”
  • -u [-d] β€” Update (transfer dirty files to peers and mark as clear) ✨
  • -H β€” List all pending hints from status db πŸ“Œ
  • -L β€” List all file-entries from status db πŸ“‚
  • -M β€” List all dirty files from status db 🧼
  • -S myname peername β€” List file-entries from status db for this synchronization pair. it's giving couple goals πŸ’ž
  • -T β€” Test if everything is in sync with all peers. vibe check, but for your whole cluster βœ…
  • -T filename β€” Test if this file is in sync with all peers. πŸ“„
  • -T myname peername β€” Test if this synchronization pair is in sync. πŸ’«
  • -T myname peer file β€” Test only this file in this sync pair. 🎯
  • -TT β€” As -T, but print the unified diffs. the receipts, the receipts!! 🧾
  • -R β€” Remove files from database which do not match config entries. bye felicia πŸ‘‹
  • -i β€” Run in inetd server mode. πŸ–₯️
  • -ii β€” Run in stand-alone server mode. πŸ–₯️πŸ–₯️
  • -iii β€” Run in stand-alone server mode (one connect only). πŸ–₯️πŸ–₯️πŸ–₯️
  • -l β€” Send some messages to syslog instead of stderr to not clobber the protocol in case stdout and stderr point to the same fd. Default for inetd mode. keeping the protocol unbothered and unclobbered, as it deserves πŸ’…

πŸ’€ Exit codes:

The modes -H, -L, -M and -S return 2 if the requested db is empty. The mode -T returns 2 if both hosts are in sync. Otherwise, only exit codes 0 (no errors) and 1 (some unspecified errors) are expected. that's it, that's the whole range bestie 😭

⭐ Modifiers:

  • -r β€” Recursive operation over subdirectories 🌲
  • -d β€” Dry-run on all remote update operations πŸ§ͺ
  • -B β€” Do not block everything into big SQL transactions. This slows down csync2 but allows multiple csync2 processes to access the database at the same time. Use e.g. when slow lines are used or huge files are transferred. slow and steady wins the race fr fr 🐒
  • -A β€” Open database in asynchronous mode. This will cause data corruption if the operating system crashes or the computer loses power. 🚨 not me warning you about the data corruption!! read that again, data corruption, be careful bestie 🚨
  • -N address β€” When running in stand-alone mode with -ii bind to a specific interface. You can pass either a hostname or ip address. If used, this value must match exactly the host value in each csync2.cfg file. must match EXACTLY, no freestyling πŸ™…
  • -I β€” Init-run. Use with care and read the documentation first! You usually do not need this option unless you are initializing groups with really large file lists. ⚠️ read the docs first, I'm so serious ⚠️
  • -X β€” Also add removals to dirty db when doing a -TI run. πŸ—‘οΈ
  • -U β€” Don't mark all other peers as dirty when doing a -TI run. πŸ™ˆ
  • -G Group1,Group2,Group3,... β€” Only use these groups from config-file. πŸŽ€
  • -P peer1,peer1,... β€” Only update these peers (still mark all as dirty). Only show files for these peers in -o (compare) mode. πŸ‘―
  • -F β€” Add new entries to dirty database with force flag set. πŸ’ͺ
  • -t β€” Print timestamps to debug output (e.g. for profiling). ⏱️
  • -s filename β€” Print timestamps also to this file. πŸ“
  • -W fd β€” Write a list of directories in which relevant files can be found to the specified file descriptor (when doing a -c run). The directory names in this output are zero-terminated. \0 and all that, iconic 🫧

πŸ—„οΈ Database switches:

  • -D database-dir or url

default: /var/lib/csync2

Absolute path: use sqlite database in that directory.

URLs:

sqlite:///some/path[/database.db3]
sqlite3:///some/path[/database.db3]
sqlite2:///some/path[/database.db]
mysql://[<user>:<password>@]<hostname>/[database]
pgsql://[<user>:<password>@]<hostname>/[database]

If database is not given, it defaults to csync2_<qualified hostname>

Note that for non-sqlite backends, the database name is "cleaned", characters outside of [0-9][a-z][A-Z] will be replaced with _. it's giving ✨glow-up✨ but for database names πŸ’…

πŸ”‘ Creating key file:

csync2 -k filename

🌍 Environment variables:

CSYNC2_SYSTEM_DIR

Directory containing csync2.cfg and other csync2 system files. Defaults to /etc.

πŸ“Œ Note:

Csync2 will refuse to do anything if this file is found:

$CSYNC2_SYSTEM_DIR/csync2.lock

literally will not do a single thing. locked out. the lock file said no and csync2 said okay periodt πŸ”’

πŸ‘€ SEE ALSO πŸ‘€

https://github.com/LINBIT/csync2/blob/master/doc/csync2.adoc
http://git.linbit.com/csync2.git/?a=blob;f=AUTHORS

This manual page is a hand-edited help2man processed csync2 help. yes, hand-edited, artisanally crafted, no cap 🎨


and that's the whole page bestie!! 🫢 this lil legend came to you from the csync2 manual, dated October 2017, and yeah the footer says csync2 on one side and CSYNC2(8) on the other β€” it's giving symmetric, it's giving balanced, it's giving main character manual energy πŸ’–βœ¨ slay, go sync your cluster, mwah πŸŽ€