Re

Get WebDAV-Sync at SourceForge.net. Fast, secure and Free Open Source software downloads

Manual

Run the binary as follows:

  java -jar webdav_sync.jar [-h] [-r] [-i seconds] \
    (-c config_file | [-e comma_separated_patterns] \
    (-down|-up|-bi) -u URL -d directory)
-h
Writes the command synopsis on the terminal.
-r
Recurs into empty directories. This is only useful if the server doesn't support "infinity" for the WebDAV "depth" property or if you are not in a position to turn it on. A server may correctly report the fact that it doesn't support this, in which case you don't need the option because the recursion will be done automatically.
-i
An interval in seconds. When set the tool loops forever and executes the synchronization every interval.
-c
A configuration file with the following form:
    <?xml version="1.0"?>
    <config>
      <sync>
        <directory>dir</directory>
        <url>https://...</url>
        <direction>down</direction>
        <!-- Optional ACL for upload. -->
        <acl xmlns="DAV:">
          <ace>
            <principal><authenticated/></principal>
            <grant>
              <privilege><read/></privilege>
            </grant>
          </ace>
        </acl>
        <exclude>filename pattern 1</exclude>
        <exclude>filename pattern 2</exclude>
        ...
      </sync>
      ...
    </config>

See RFC 3744 for the ACL syntax.

-e
An optional comma-separated list of filename patterns. Files that match a pattern are excluded from the synchronization.
-down|-up|-bi
The synchronization direction.
-u
The URL.
-d
The local directory.

Use it as an Ant task through the taskdef element:

  <taskdef
    name="webdav-sync"
    classname="be.re.webdav.cmd.SyncAntTask"
    classpath="<directory>/webdav_sync.jar" />

The Ant task has five parameters: directory, url, recur, which is either true or false, excludes, which is a list of filename patterns, and direction, which can be down, up or bi. The parameters recur and excludes are optional.

The URL might require a username and a password. You can specify it in the URL like this: https://username:password@hostname/.... Note that if the username or the password contain characters that must not appear in the URL at that place, they should be escaped using URI-encoding. For example, @ should be %40, : becomes %3a, etc. See also http://en.wikipedia.org/wiki/Percent-encoding.

A safer method is to configure it with UIVI. On the Settings tab go to the subtab URL Authentications and append a row with the pop-up menu.

A non-compliant server might respond with a Bad Request. This usually means it doesn't support compression, but responds with a 400 instead of a 415, which is what normal content negotiation prescribes. You can add -Dbe.re.http.no-compress to the beginning of the command-line and file a bug report at the provider of your server.

Some servers don't support the 100-continue feature, but fail to report this with a 417 status code. In that case you can add -Dbe.re.http.no-expect100 to the beginning of the command-line.