The Sync Tool is a utility which was created in order to provide a simple way to move files from a local file system to DuraCloud and subsequently keep the files in DuraCloud synchronized with those on the local system.
Download the sync tool from the Downloads page.
The Sync Tool can be installed using one of the installers on the downloads page linked above. Once installed, the Sync Tool will default to running in GUI mode. To run in command line mode, open a terminal window (or command prompt) and navigate to the Sync Tool installation directory. Once there, execute the Sync Tool JAR file using: "java -jar duracloudsync.jar --help". This will print the usage information for the tool.
Some users have a need to prefix their content IDs in order that the paths to the content appear in DuraCloud differently than what appears on the file system. Suppose the path to a local file (relative to the watch directory) is "dir1/file.txt" and the user would like the resulting content stored in DuraCloud as 'a/b/c/dir1/file.txt. To achieve that result, the a destination prefix of "a/b/c/" would need to be set.
Changing the destination prefix between synchronization runs when the "sync deletes" option is enabled will likely cause in all content in duracloud in that space to be deleted and re-uploaded. Be cautious when enabling this feature if you have already uploaded content to your DuraCloud space. |
Optimizing Transfer Rate
As of DuraCloud version 2.2.0, the Sync Tool requires Java 7 to run. The latest version of Java can be downloaded from here. |
You must have Java version 7 or above installed on your local system. If Java is not installed, or if a previous version is installed, you will need to download and install Java 7. To determine if the correct version of Java is installed, open a terminal or command prompt and enter
java -version |
The version displayed should be 1.7.0 or above. If running this command generates an error, Java is likely not installed.
To display the help for the Sync Tool, run
java -jar duracloudsync-{version}.jar --help |
When running the Sync Tool for the first time, you will need to use these options:
Short Option | Long Option | Argument Expected | Required | Description | Default Value (if optional) |
---|---|---|---|---|---|
-h | --host | Yes | Yes | The host address of the DuraCloud DuraStore application |
|
-r | --port | Yes | No | The port of the DuraCloud DuraStore application | 443 |
-i | --store-id | Yes | No | The Store ID for the DuraCloud storage provider | The primary storage provider is used |
-s | --space-id | Yes | Yes | The ID of the DuraCloud space where content will be stored |
|
-u | --username | Yes | Yes | The username necessary to perform writes to DuraStore |
|
-p | --password | Yes | No | The password necessary to perform writes to DuraStore. If not specified the retrieval tool will first check to see if an environment variable named "DURACLOUD_PASSWORD" exists, if it does exist the retrieval tool will use its value as the password, otherwise you will be prompted to enter the password. | Not set |
-c | --content-dirs | Yes | Yes | A list of the directory paths to monitor and sync with DuraCloud. If multiple directories are included in this list, they should be separated by a space. |
|
-a | --prefix | Yes | No | A prefix to be added to the content IDs of all files in the content directories as they are added to DuraCloud. The same prefix applies to all files in all content directories. For example, if a content directory is C:/users/bob/pictures with one file in it, C:/users/bob/pictures/001.jpg, and the prefix value is "bobs-pictures/", the file would be given a DuraCloud content ID of bobs-pictures/001.jpg. Note that the name of the content directory is not included in the path, so if you would like for it to appear as part of the content ID, you will need to include it in the prefix. Also note that the prefix does not need to be a directory name, it can be any value. If, however, you would like for it to appear as a directory path, do not forget to end the prefix with a "/" character. | Not set |
-w | --work-dir | Yes | No | The state of the sync tool is persisted to this directory. If not specified, this value will default to a directory named duracloud-sync-work in the user's home directory. | duracloud-sync-work |
-f | --poll-frequency | Yes | No | The time (in ms) to wait between each poll of the sync-dirs | 10000 (10 seconds) |
-t | --threads | Yes | No | The number of threads in the pool used to manage file transfers | 3 |
-m | --max-file-size | Yes | No | The maximum size of a stored file in GB (value must be between 1 and 5), larger files will be split into pieces | 1 |
-n | --rename-updates <suffix> | No | No | <suffix> indicates that updates should be synced to the cloud and renamed. Specify an optional suffix to override default ( ".orig"). To prevent updates altogether, see option -o. (Note that this option cannot be used together with either the -o or the -d options.) | |
-o | --no-update | No | No | Indicate that changed files should not be updated. In order to perform updates without overwriting, see option -n. | |
-d | --sync-deletes | No | No | Indicates that deletes performed on files within the content directories should also be performed on those files in DuraCloud; if this option is not included all deletes are ignored | Not set |
-x | --exit-on-completion | No | No | Indicates that the sync tool should exit once it has completed a scan of the content directories and synced all files; if this option is included, the sync tool will not continue to | Not set |
-l | --clean-start | No | No | Indicates that the sync tool should perform a clean start, ensuring that all files in all content directories are checked against DuraCloud, even if those files have not changed locally since the last run of the sync tool | Not set |
-e | --exclude | Yes | No | The full path to a file which specifies a set of exclusion rules. The purpose of the exclusion rules is to indicate that certain files or directories should not be transferred to DuraCloud. The rules must be listed one per line in the file. The rules will match only on the name of a file or directory, not an entire path, so path separators should not be included in rules. Rules are not case sensitive (so a rule "test.log" will match a file "test.LOG"). The rules may include wildcard characters ? and *. The ? matches a single character, while * matches 0 or more characters. Examples of valid rules: | Not set |
When the Sync Tool runs, it creates a backup of your configuration in the work directory that you specify. When running the tool again, you can make use of this file to keep from having to re-enter all of the options specified on the initial run. In this case you need only a single option:
Short Option | Long Option | Argument Expected | Required | Description |
---|---|---|---|---|
-g | --config-file | Yes | Yes | Read configuration from this file (a file containing the most recently used configuration can be found in the work-dir, named synctool.config) |
Command to sync the contents of a single local content directory to DuraCloud.
java -jar duracloudsync-{version}.jar -c C:\files\important -h test.duracloud.org -s important-dir-backup -u myname -p mypassword |
Command to sync the contents of multiple local content directories to DuraCloud.
java -jar duracloudsync-{version}.jar -c C:\files\important C:\Users\me\Documents\important -h test.duracloud.org -s important-dir-backup -u myname -p mypassword |
While the Sync Tool is running, these commands are available. Just type them on the command line where the tool is running. These commands are not available when running in exit-on-completion mode.
Short Command | Long Command | Description |
---|---|---|
x | exit | Tells the Sync Tool to end its activity and close |
c | config | Prints the configuration of the Sync Tool (the same information is printed at startup) |
s | status | Prints the current status of the Sync Tool |
l <Level> | N/A | Changes the log level to <Level> (may be any of DEBUG, INFO, WARN, ERROR) |
h | help | Prints the runtime command help |