From a48f4a85e6141f935d0647abd5e9e104cfa76914 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Wed, 25 Dec 2019 17:59:20 +0100 Subject: [PATCH 1/2] Make remarklint happy in codacy --- README.md | 79 +++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 4d0e795..f4a1a1b 100644 --- a/README.md +++ b/README.md @@ -9,21 +9,21 @@ This is a quickstart guide, you can find the full documentation on the author's **22 May 2019: I am happy to announce that osync 1.3-beta3 passed it's tests on all target platforms. In order to speed up a osync 1.3 final release, please consider testing this beta.** -About ------ +## About + osync provides the following capabilities -- Local-Local and Local-Remote sync -- Fault tolerance with resume scenarios -- POSIX ACL and extended attributes synchronization -- Full script Time control -- Soft deletions and multiple backups handling -- Before / after run command execution -- Email alerts -- Logging facility -- Directory monitoring -- Running on schedule or as daemon -- Batch runner for multiple sync tasks with rerun option for failed sync tasks +- Local-Local and Local-Remote sync +- Fault tolerance with resume scenarios +- POSIX ACL and extended attributes synchronization +- Full script Time control +- Soft deletions and multiple backups handling +- Before / after run command execution +- Email alerts +- Logging facility +- Directory monitoring +- Running on schedule or as daemon +- Batch runner for multiple sync tasks with rerun option for failed sync tasks osync is a stateful synchronizer. This means it's agentless and doesn't have to monitor files for changes. Instead, it compares replica file lists between two runs. A full run takes about 2 seconds on a local-local replication and about 7 seconds on a local-remote replication. @@ -38,8 +38,8 @@ Microsoft Windows is supported via MSYS or Cygwin and now via Windows 10 bash. Android support works via Termux. Some users also have successfully used osync on Gentoo and created an openRC init scriptt for it. -Installation ------------- +## Installation + osync has been designed to not delete any data, but rather make backups of conflictual files or soft deletes. Nevertheless, you should always have a neat backup of your data before trying a new sync tool. @@ -85,35 +85,35 @@ You can upgrade all v1.0x-v1.2-dev config files by running the upgrade script The script will backup your config file, update it's content and try to connect to initiator and target replicas to update the state dir. -Usage ------ +## Usage + Osync can work with in three flavors: Quick sync mode, configuration file mode, and daemon mode. While quick sync mode is convenient to do fast syncs between some directories, a configuration file gives much more functionnality. Please use double quotes as path delimiters. Do not use escaped characters in path names. -QuickSync example ------------------ +## QuickSync example + # osync.sh --initiator="/path/to/dir1" --target="/path/to/remote dir2" # osync.sh --initiator="/path/to/another dir" --target="ssh://user@host.com:22//path/to/dir2" --rsakey=/home/user/.ssh/id_rsa_private_key_example.com -Summary mode ------------- +## Summary mode + osync may output only file changes and errors with the following # osync.sh --initiator="/path/to/dir1" --target="/path/to/dir" --summary --errors-only --no-prefix This also works in configuration file mode. -QuickSync with minimal options ------------------------------- +## QuickSync with minimal options + In order to run osync the quickest (without transferring file attributes, without softdeletion, without prior space checks and without remote connectivity checks, you may use the following: # MINIMUM_SPACE=0 PRESERVE_ACL=no PRESERVE_XATTR=no SOFT_DELETE_DAYS=0 CONFLICT_BACKUP_DAYS=0 REMOTE_HOST_PING=no osync.sh --initiator="/path/to/another dir" --target="ssh://user@host.com:22//path/to/dir2" --rsakey=/home/user/.ssh/id_rsa_private_key_example.com All the settings described here may also be configured in the conf file. -Running osync with a Configuration file ---------------------------------------- +## Running osync with a Configuration file + You'll have to customize the sync.conf file according to your needs. If you intend to sync a remote directory, osync will need a pair of private / public RSA keys to perform remote SSH connections. Also, running sync as superuser requires to configure /etc/sudoers file. @@ -138,8 +138,8 @@ Once you're confident about your first runs, you may add osync as a cron task li Please note that this syntax works for RedHat / CentOS. On Debian you might want to remove the username (ie root) in order to make the crontab entry work. -Batch mode ----------- +## Batch mode + You may want to sequentially run multiple sync sets between the same servers. In that case, osync-batch.sh is a nice tool that will run every osync conf file, and, if a task fails, run it again if there's still some time left. The following example will run all .conf files found in /etc/osync, and retry 3 times every configuration that fails, if the whole sequential run took less than 2 hours. @@ -150,8 +150,8 @@ Having multiple conf files can then be run in a single cron command like 00 00 * * * root /usr/local/bin/osync-batch.sh --path=/etc/osync --silent -Daemon mode ------------ +## Daemon mode + Additionaly, you may run osync in monitor mode, which means it will perform a sync upon file operations on initiator replica. This can be a drawback on functionnality versus scheduled mode because this mode only launches a sync task if there are file modifications on the initiator replica, without being able to monitor the target replica. Target replica changes are only synced when initiator replica changes occur, or when a given amount of time (default 600 seconds) passed without any changes on initiator replica. @@ -182,13 +182,13 @@ OpenRC specific instructions (user contrib) Launch service (one service per config file to launch) with: $ rc-update add osync-srv.configfile default -Security enhancements ---------------------- +## Security enhancements + Remote SSH connection security can be improved by limiting what hostnames may connect, disabling some SSH options and using ssh filter. Please read full documentation in order to configure ssh filter. -Contributions -------------- +## Contributions + All kind of contribs are welcome. When submitting a PR, please be sure to modify files in dev directory (dev/n_osync.sh, dev/ofunctions.sh, dev/common_install.sh etc) as most of the main files are generated via merge.sh. @@ -199,22 +199,21 @@ SSH port can be changed on the fly via environment variable SSH_PORT, eg: SSH_PO Consider reading CODING_CONVENTIONS.TXT before submitting a patch. -Troubleshooting ---------------- -You may find osync's logs in /var/log/osync.[INSTANCE_ID].log (or current directory if /var/log is not writable). +## Troubleshooting + +You may find osync's logs in `/var/log/osync.[INSTANCE_ID].log` (or current directory if /var/log is not writable). Additionnaly, you can use the --verbose flag see to what actions are going on. When opening an issue, please post the corresponding log files. Also, you may run osync with _DEBUG option in order to have more precise logs, eg: _DEBUG=yes ./osync.sh /path/to/conf +## Uninstalling -Uninstalling ------------- The installer script also has an uninstall mode that will keep configuration files. Use it with $ ./install.sh --remove -Author ------- +## Author + Feel free to open an issue on github or mail me for support in my spare time :) Orsiris de Jong | ozy@netpower.fr From 6139fa002b9bd0c4a2f9c83789db9d375dec7f19 Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Wed, 25 Dec 2019 18:03:44 +0100 Subject: [PATCH 2/2] Another remarklint fix --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f4a1a1b..5af4749 100644 --- a/README.md +++ b/README.md @@ -43,8 +43,8 @@ Some users also have successfully used osync on Gentoo and created an openRC ini osync has been designed to not delete any data, but rather make backups of conflictual files or soft deletes. Nevertheless, you should always have a neat backup of your data before trying a new sync tool. -You may get osync on the author's site (stable version) or on github (stable or latest dev snapshot) -Getting osync via author's site on **http://www.netpower.fr/osync** +You may get osync on github (stable or latest dev snapshot) or on the author's site (stable version) +Getting osync via author's site on $ wget http://www.netpower.fr/projects/osync/osync.v1.2.tar.gz $ tar xvf osync.v1.2.tar.gz @@ -71,7 +71,7 @@ On *BSD and BusyBox, be sure to have bash installed. If you can't install osync, you may just copy osync.sh where you needed and run it from there. -Archlinux packages are available at https://aur.archlinux.org/packages/osync/ (thanks to Shadowigor, https://github.com/shadowigor) +Archlinux packages are available at (thanks to Shadowigor, ) ## Upgrade from previous configuration files