Syncrify » Knowledge base

Document information

Document ID:4494
Subject:Running Syncrify on Synology NAS
Creation date:11/12/15 9:52 PM
Last modified on:8/22/16 2:54 PM


Running Syncrify on Synology NAS

Synology NAS provides an easy and convenient way of storing large data with redundancy when combined with RAID. Installing and running Syncrify Server on Synology is, therefore, a natural fit. This blog talks about how to install and run Syncrify on a Synology NAS.

It contains 3 parts:

  • Installing Java JRE
  • Installing and configuring Syncrify
  • Starting Syncrify at boot-time

Assumptions:

This document assumes you have working knowledge of Linux operating system, such as connecting to a remote machine using SSH.

Prerequisite - Installing Java JRE

Before installing Syncrify, you need to install Java JRE. Following steps demonstrate how to install Java JRE on Synology.

  • Connect to Synology DSM using a browser from your Windows or MAC computer.
  • Once logged in, start the Package Manager and Search for Java



  • Next, you will have to download necessary binary from Oracle's web site. The link is provided on the following window.



  • Once the binaries have been downloaded on your local machine, upload the file to Synology by clicking the Browse button and selecting Ok.
  • You should see a confirmation next.



  • Finally, you should see the path where Java is installed.


    This information is important and you will need it in the following steps. Copy this path in a document.

Enabling SSH

You will need to access Synology via SSH or Telnet. Obviously, SSH is preferred because it is secure. Use the following steps to enable SSH.

  • Open Control Panel within DSM
  • Click Terminal and SNMP
  • Enable SSH.

Accessing NAS through SSH

Next, open an SSH session to Synology. On Windows, you can use Putty or Terminal on Mac OS X. In this example, we will install Syncrify in /volume1/opt/Syncrify folder using the following commands:

First, elevate your login to root using the following command.
sudo su
Note: If you get an error complaining "sudo" is an invalid command, try using "root" instead of "admin" when establishing SSH connection. The password for "root" and "admin" should be same on Synology.

Then, create necessary folder:
mkdir /volume1/opt/Syncrify


Change directory to the newly created folder
cd /volume1/opt/Syncrify


Download Syncrify
wget http://www2.synametrics.com/files/Syncrify/SyncrifyOther.tar.gz

Next, extract compressed file using the following command
tar -zxvf SyncrifyOther.tar.gz


Launch script

Normally Syncrify runs by executing run.sh script in the installation (/volume1/opt/Syncrify). However, our goal is to start Syncrify when the NAS device reboots. In order to do that, we will need to modify the existing script and make some minor adjustments. Rather than modifying the existing run.sh, we recommend you create a copy and use that instead. Let's call this copy launchAtBoot.sh

The contents of launchAtBoot.sh are displayed below.

cd /volume1/opt/Syncrify
CP=
for i in `ls lib/*.jar`
do
CP=$CP:$i
done
echo $CP
/var/packages/Java7/target/j2sdk-image/bin/java -server -Xmx512m -cp $CP -DLoggingConfigFile=logconfig.xml com.synametrics.sradef.BootLoader


Lines highlighted in yellow have been updated to match the environment. Other than that, there is no difference between launchAtBoot.sh and run.sh. First, we change the current directory to the location where Syncrify is installed. Second, we specify the absolute path for java binary. These changes allow us to run the script from any location.
TIP!
If you are not sure the path for java, type the following command:
which java
This should display the path where java is installed, which should be used for the second (yellow) line above.


Important Note

You may have to add execute permission to launchAtBoot.sh, which is done using the following command:
chmod +x launchAtBoot.sh

Configuration change

Since java and the installation folder is not in System path, following changes in AppConfig.xml file are required to restart Syncrify from its web interface.

  • Locate AppConfig.xml file in /volume1/opt/Syncrify/config folder.
  • This file is in XML format containing several parameters. Two parameters need to be modified: jvmPath and ntServiceCommand. The parameter lines should appear like following after modification.
    <parameter name="jvmPath" type="1" value="/var/packages/Java7/target/j2sdk-image/bin/java"></parameter>
    <parameter name="ntServiceCommand" type="1" value="start syncrify"></parameter>
    
  • Save AppConfig.xml after modifying the values

Changing $TEMP

Syncrify needs a temporary location on the disk to perform several tasks. The default location for this TEMP folder is /tmp on Synology. This location is not big enough, particularly if you plan to backup large files. Therefore, it is strongly recommended that you modify the path where temporary files are stored.

For this example, we will use /volume1/opt/SyncrifyTemp folder. Following steps demonstrate how to modify the TEMP folder in Syncrify.
  • Modify or create server.properties file in /volume1/opt/Syncrify/config
  • Add the following line:
    java.io.tmpdir=/volume1/opt/SyncrifyTemp
  • Save the file

Running Syncrify at boot time

There are two ways to run Syncrify at boot time:
This method only works if you are using DSM 6.0. Consider upgrading your Synology if you are using an older build.

Starting from version 6.0, Synology DSM contains an ability to run scripts at boot time. Using this wizard, you can execute launchAtBoot.sh when your NAS device reboots.

Step-by-Step

  • Connect to Synology DSM using your browser
  • Click Control Panel
  • Click Task Scheduler
  • Create a new Triggered Task for User-defined script
  • Select Boot-up for Event and specify a name, for example Syncrify
  • Select the Task Settings tab and specify /volume1/opt/Syncrify/launchAtBoot.sh for script. Refer to the image below

    Screen shot Syncrify Synology
  • Click Ok
Synology uses upstart daemon to execute programs at boot time. This requires a script in /etc/init. Let call this script syncrify.conf. It should have the following contents.

		description "Syncrify daemon"
		author "Synametrics Technologies, Inc."
		#start Syncrify on the following run levels
		start on runlevel [2345]
#stop Syncrify gracefully if the runlevel changes to 'reboot' stop on runlevel [06] #finally, execute the script exec /volume1/opt/Syncrify/launchAtBoot.sh

Testing the launch script

To start Syncrify, type the following at the prompt.

start syncrify

It does not matter what is your current directory when running start. That is because the binary is located in /sbin/ folder, should be in your system PATH. To stop Syncrify, run:

stop syncrify
Finally, try opening http://YourSynologyNas:5800 from a browser on your desktop computer to access its web interface.

Troubleshooting common problems

An important tool in troubleshooting any problem is to see the log file, which is located in /var/log/upstart/syncrify.log . Messages printed to standard output go this file and comes handy if you run into problems.






User comments

Posted by Greg Johnson on 10/17/17 9:33 PM

When I am downloading via SSH - No such file or directory. When I go to that link via a Windows machine I am able to download it. Do you know why? ash-4.3# wget http://www2.synametrics.com/files/Syncrify/SyncrifyOther.tar.gz ash: wget http://www2.synametrics.com/files/Syncrify/SyncrifyOther.tar.gz: No such file or directory

Posted by Andre on 3/10/16 9:32 AM

Hello I've followed your tutorial step by step on my synology. Starting the job manually i get the following error: start: Name "com.ubuntu.Upstart" does not exist There's no log file created with further informations. Any advice?! Regards - André


Add a comment to this document

Do you have a helpful tip related to this document that you'd like to share with other users? Please add it below. Your name and tip will appear at the end of the document text.
Your name:
Your email:
Hide my email address
Verification code:
Enter the verification code you see above more submitting your tip
Tip:Please limit tips to 1000 characters

Navigation

Social Media

Powered by 10MinutesWeb.com