# osync [![Build Status](https://travis-ci.org/deajan/osync.svg?branch=master)](https://travis-ci.org/deajan/osync) [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) [![GitHub Release](https://img.shields.io/github/release/deajan/osync.svg?label=Latest)](https://github.com/deajan/osync/releases/latest) [![Percentage of issues still open](http://isitmaintained.com/badge/open/deajan/osync.svg)](http://isitmaintained.com/project/deajan/osync "Percentage of issues still open") [![Codacy Badge](https://api.codacy.com/project/badge/Grade/651acb2fd64642eb91078ba523b7f887)](https://www.codacy.com/app/ozy/osync?utm_source=github.com&utm_medium=referral&utm_content=deajan/osync&utm_campaign=Badge_Grade)
[![Percentage of issues still open](http://isitmaintained.com/badge/open/deajan/osync.svg)](http://isitmaintained.com/project/deajan/osync "Percentage of issues still open")
A two way filesync script running on bash Linux, BSD, Android, MacOSX, Cygwin, MSYS2, Win10 bash and virtually any system supporting bash).
A two way filesync script running on bash Linux, BSD, Android, MacOSX, Cygwin, MSYS2, Win10 bash and virtually any system supporting bash).
File synchronization is bidirectional, and can be run manually, as scheduled task, or triggered on file changes in daemon mode.
File synchronization is bidirectional, and can be run manually, as scheduled task, or triggered on file changes in daemon mode.
@ -30,8 +38,8 @@ osync uses pidlocks to prevent multiple concurrent sync processes on/to the same
You may launch concurrent sync processes on the same system but as long as the replicas to synchronize are different.
You may launch concurrent sync processes on the same system but as long as the replicas to synchronize are different.
Multiple osync tasks may be launched sequentially by osync osync-batch tool.
Multiple osync tasks may be launched sequentially by osync osync-batch tool.
Currently, it has been tested on CentOS 5.x, 6.x, 7.x, Fedora 22-25, Debian 6-8, Linux Mint 14-18, Ubuntu 12.04-12.10, FreeBSD 8.3-11, Mac OS X, QTS 4.5.1(x86) and pfSense 2.3.x.
Currently, it has been tested on CentOS 5.x, 6.x, 7.x, AlmaLinux 9, Fedora 22-25, Debian 6-11, Linux Mint 14-18, Ubuntu 12.04-22.04, FreeBSD 8.3-11, Mac OS X, QTS 4.5.1(x86) and pfSense 2.3.x.
Microsoft Windows is supported via MSYS or Cygwin and now via Windows 10 bash.
Microsoft Windows is supported via MSYS, Cygwin and or via WSL.
Android support works via Termux.
Android support works via Termux.
Some users also have successfully used osync on Gentoo and created an openRC init scriptt for it.
Some users also have successfully used osync on Gentoo and created an openRC init scriptt for it.
@ -40,12 +48,6 @@ 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.
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.
Nevertheless, you should always have a neat backup of your data before trying a new sync tool.
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 <https://www.netpower.fr/osync>
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. Need to keep this flag.
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. We need to create these flag files for ERROR_ALERT / WARN_ALERT to be picked up by Alert
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. Need to keep this flag.
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. We need to create these flag files for ERROR_ALERT / WARN_ALERT to be picked up by Alert
# Update remote conf files with SSH port and file id location
sed -i.tmp 's#ssh://.*@localhost:[0-9]*/${HOME}/osync-tests/target#ssh://'$REMOTE_USER'@localhost:'$SSH_PORT'/${HOME}/osync-tests/target#'"$CONF_DIR/$REMOTE_CONF"
sed -i.tmp 's#ssh://.*@localhost:[0-9]*/${HOME}/osync-tests/target#ssh://'$REMOTE_USER'@localhost:'$SSH_PORT'/'${homedir}'/osync-tests/target#'"$CONF_DIR/$REMOTE_CONF"
sed -i.tmp2 's#SSH_RSA_PRIVATE_KEY="${HOME}/.ssh/id_rsa_local_osync_tests"#SSH_RSA_PRIVATE_KEY="'${homedir}'/.ssh/id_rsa_local_osync_tests"#'"$CONF_DIR/$REMOTE_CONF"
@ -1226,7 +1267,7 @@ function xtest_ConflictDetetion () {
return0
return0
}
}
functionxtest_WaitForTaskCompletion (){
function test_WaitForTaskCompletion (){
local pids
local pids
# Tests compatible with v1.1 syntax
# Tests compatible with v1.1 syntax
@ -1320,7 +1361,7 @@ function xtest_WaitForTaskCompletion () {
assertEquals "WaitForTaskCompletion test 5""2"$?
assertEquals "WaitForTaskCompletion test 5""2"$?
}
}
functionxtest_ParallelExec (){
function test_ParallelExec (){
if["$OSYNC_MIN_VERSION"=="1"];then
if["$OSYNC_MIN_VERSION"=="1"];then
echo"Skipping ParallelExec test because osync v1.1 ofunctions don't have this function."
echo"Skipping ParallelExec test because osync v1.1 ofunctions don't have this function."
return0
return0
@ -1381,7 +1422,7 @@ function xtest_ParallelExec () {
assertNotEquals "ParallelExec full test 3""0"$?
assertNotEquals "ParallelExec full test 3""0"$?
}
}
functionxtest_timedExecution (){
function test_timedExecution (){
local arguments
local arguments
# Clever usage of indexes and exit codes
# Clever usage of indexes and exit codes
@ -1427,7 +1468,7 @@ function xtest_timedExecution () {
done
done
}
}
functionxtest_UpgradeConfRun (){
function test_UpgradeConfRun (){
if["$OSYNC_MIN_VERSION"=="1"];then
if["$OSYNC_MIN_VERSION"=="1"];then
echo"Skipping Upgrade script test because no further dev will happen on this for v1.1"
echo"Skipping Upgrade script test because no further dev will happen on this for v1.1"
return0
return0
@ -1444,7 +1485,7 @@ function xtest_UpgradeConfRun () {
assertEquals "Conf file upgrade""0"$?
assertEquals "Conf file upgrade""0"$?
# Update remote conf files with SSH port
# Update remote conf files with SSH port
sed -i.tmp 's#ssh://.*@localhost:[0-9]*/${HOME}/osync-tests/target#ssh://'$REMOTE_USER'@localhost:'$SSH_PORT'/${HOME}/osync-tests/target#' "$CONF_DIR/$TMP_OLD_CONF"
sed -i.tmp 's#ssh://.*@localhost:[0-9]*/${homedir}/osync-tests/target#ssh://'$REMOTE_USER'@localhost:'$SSH_PORT'/${homedir}/osync-tests/target#' "$CONF_DIR/$TMP_OLD_CONF"
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. Need to keep this flag.
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. We need to create these flag files for ERROR_ALERT / WARN_ALERT to be picked up by Alert
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. Need to keep this flag.
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. We need to create these flag files for ERROR_ALERT / WARN_ALERT to be picked up by Alert
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. Need to keep this flag.
# ERROR_ALERT / WARN_ALERT is not set in main when Logger is called from a subprocess. We need to create these flag files for ERROR_ALERT / WARN_ALERT to be picked up by Alert