Background synchronization

nlmarco edited this page Apr 29, 2014 · 7 revisions

Introduction

The most common scenario is that you set one or more repositories up and then expect all data to be synchronized automatically in the background.

It is assumed in the following, that at least one repository (e.g. the folder "Documents" in your user's home directory) was turned into a repository as shown in the "Getting started" guide. Otherwise cloudstore sync ALL won't do anything.

System cron job (GNU/Linux)

On the client computer, you execute the following command to configure the current user's cron jobs (execute su - or sudo -i before, if you want to run the cron job as root):

crontab -e

This will open a text editor. Here you can add the following line:

00  *  *  *  *  (. /etc/profile ; cloudstore sync ALL) >> /tmp/cloudstore_ALL.cron 2>&1

After you saved this crontab, the system's cron daemon will execute the command cloudstore sync ALL every full hour (the '00' at the beginning is the minute). The . /etc/profile ; before the actual command makes sure that the environment is the same as that of a normal user in an ordinary shell (and thus both the java and the cloudstore executables are in the path, if you followed the Installation guide).

The IO redirection after the command (starting with the ">>" and ending with the "2>&1") makes sure all output is written to this temporary file, which is useful for diagnostics. You might want to change the file inbetween to "/dev/null" instead. CloudStore writes a log file (in ~/.cloudstore/log/), anyway.

Please note that you'll have to add the fully qualified path - e.g. /opt/cloudstore/bin/cloudstore sync ALL - if you did not add CloudStore to the PATH as described in the Installation guide.

For more information, please consult cron and related documentation.

System cron job (Windows)

Windows is also capable of executing a program periodically. There are two possibilities to set this up:

GUI

Open the Control panel, look for Schedule tasks, and start the Create task... wizard.

Command line

Easier and faster than the GUI is the command line. You simply open the Command prompt. In the command line, you can execute the following command to add a new task:

schtasks /create /tn "CloudStore" /tr "W:\cloudstore\bin\cloudstore.bat sync ALL" /sc HOURLY

This creates the task named "CloudStore" which will be executed once per hour. Of course, you have to replace "W:\cloudstore" by the path you installed CloudStore to. And if you added it to the system's PATH, you can omit the entire path.

Note, that you must reference the cloudstore command as cloudstore.bat - it does not work without the file extension.

CloudStore server timer

This feature does not yet exist, but will be implemented soon.

The idea is to do the same as the system's cron job, but platform independently directly in the CloudStore server.

React on file system changes

This feature does not yet exist, but will be implemented soon.

The idea is to use a watch service to react on a file system change pretty immediately.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.