Repository Synchronization refers to the synchronization between a local directory and a remote directory within the Repository. According to your configuration of direction, Ambience enables you to drag and drop files into one end and automatically reflects the folder content changes in the other end.
Different from the main features of Ambience, the Repository Synchronization feature needs some manual configurations from the user before it starts to function. In this section, "server" refers to the machine running the Ambience suite, and "client" refers to the end user's machine.
Prerequisite: The server is already set up and running.
Complete the following steps on the client:
Install two .deb files using the following command lines:
sudo dpkg --install elx-arch_2.5-1_all.deb sudo dpkg --install elx-dacapo-sync_2.5-1_all.deb
If client and server are the same machine, it means you already have elx-arch installed.
Edit the configuration file using the following command line:
sudo emacs /etc/elixir/dacapo-sync/sync.xml
You have the option to use any editor according to your preference. For example, you can
replace sudo emacs with sudo gedit.
The default configuration file contains the following code segment:
<?xml version="1.0"?>
<sync-config initial-delay="120">
<!-- 120 gives system two minutes to get started -->
<server url="http://knockshinnie:8080/elx" domain="eno"
username="admin" password="9ILS4lhvu8HjaYFjZy6KjQ==">
<local path="/home/jon/DaCapo"/>
<remote path="/User/admin"/>
<action interval="300" direction="both" change-trigger=
"true"/>
<!-- direction may be up, down or both -->
</server>
</sync-config>You have to edit the following values:
The server url value needs to reflect your machine.
Change the domain value as appropriate.
Choose the username and password for authentication. The password must be encrypted (the default value here is "sa"). Please use the encryption tool at /opt/elixir/dacapo-sync/encrypt.sh to encrypt your password.
The following command lines show how to use the encryption tool. When running the command, please replace "sa" with your own password:
username@/opt/elixir/dacapo-sync: ./encrypt.sh sa Encrypted value: 9ILS4lhvu8HjaYFjZy6KjQ==
Choose the local directory that you want files to be mirrored to or from. All child directories will be mirrored too.
Choose the Repository folder that you want files to be mirrored to or from. All child folders will be mirrored.
Set the frequency of synchronization. The unit is second, hence 300 means 5 minutes. Set the direction as well.
If the direction value is set to "up", client files will be sent to the server. Any files added on the server will not be replicated to the client. Files deleted on the client will not be deleted on the server.
If the direction value is set to "down", server files will be sent to the client. Any files added on the client will not be replicated to the server. Files deleted on the server will not be deleted on the client.
If the direction value is set to "both", the system will ensure the files are fully synchronized in both directions. In this mode, the system recognizes deletes on either the client or server side, and replicates them on the other.
You can have as many <server> sections within the <sync-config> as you need. Therefore you can mirror multiple folders independently.
Edit another configuration file using the following command line:
sudo emacs /etc/init.d/elx-dacapo-sync
This script starts or stops the Repository Synchronization service. By default it is set to run as the "elixir" user:
#the user that will run the script USER=elixir
You need to change elixir to your own (linux) account name. Then the service will run as your (linux) account name and ensure that
files have your permissions.
If the service is running as your (linux) account name, it won't have permissions to write logs to /var/log/elixir. Please choose one of the following options:
Option 1: Assign yourself permissions to write to the log folder, by running the following command lines:
sudo chown elixir:USERNAME /var/log/elixir sudo chmod g+w /var/log/elixir
Option 2: Change the logging folder in /etc/elixir/dacapo-sync/log4j.properties, to point to a folder that you have write access to:
log4j.appender.ROLLINGFILE.File=/var/log/elixir/dacapo-sync.log
Start the Repository Synchronization service by running the following command line:
sudo service elx-dacapo-sync start
If you make further changes to the configuration files, e.g. adding new directories you want to mirror, please restart the Repository Synchronization service to have them read:
sudo service elx-dacapo-sync restart
If you want to stop or even remove the service, please run the following commands:
sudo service elx-dacapo-sync restart sudo dpkg --remove elx-dacapo-sync