Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Please look at http://www.sos-berlin.com/doc/en/jade/JADE%20Parameter%20Reference.pdf for an overview about all parameters.

Example: transfer from WebDAV server to local file system

First we make some global profiles for WebDAV to local transfer.

[local_target_host]
target_protocol=local
target_dir = /tmp/test/jade/in

[webdav_source_host]
source_protocol=webdav
source_host=http://homer.sos/jade
source_port=80
source_user=test
source_password=12345
source_ssh_auth_method=url

[copy_webdav2local]
include = webdav_source_host,local_target_host
operation = copy

The profile copy_webdav2local will be included in further profiles

Example with file_path

In the file_path option you can enter a list of source files.

  • If the option source_dir is empty then these files must have absolute paths from the viewpoint of the WebDAV server (e.g. DocumentRoot setting in apache).
  • If the option source_dir is not empty then these files must have paths relative to the source_dir directory.
     The _source_dir_ directory must have an absolute path from the viewpoint of the WebDAV server (e.g. DocumentRoot setting in apache).
    
    In this example we have two files with the same name (/jade/out/1.txt and /jade/out2/1.txt).

After the transfer they are only one file /tmp/test/jade/in/1.txt in the target directory.

This is a special situation but a good example to discuss the different behaviour depending on the options overwrite_files (default:true) and append_files (default:false).

Here we have three profiles:

[filepath_append]
include = copy_webdav2local
file_path = /jade/out/1.txt;/jade/out2/1.txt
append_files = true 


[filepath_no_overwrite]
include = copy_webdav2local
file_path = /jade/out/1.txt;/jade/out2/1.txt
overwrite_files = false


[filepath_overwrite]
include = copy_webdav2local
file_path = /jade/out/1.txt;/jade/out2/1.txt
  • In the first example filepath_append the target file has the content of both source files.
    The second transfer of /jade/out2/1.txt appends the already existing target file /tmp/test/jade/in/1.txt which was created after the first transfer of /jade/out/1.txt.
  • In the second example filepath_no_overwrite the target file has the content of the first source files (/jade/out/1.txt).
    The second transfer of /jade/out2/1.txt is skipped because /tmp/test/jade/in/1.txt already exists after the first transfer of /jade/out/1.txt.
  • In the third example filepath_overwrite the target file has the content of the second source files (/jade/out2/1.txt).
    The second transfer of /jade/out2/1.txt overwrites the target file /tmp/test/jade/in/1.txt from the first transfer of /jade/out/1.txt.

You can also set

file_path = 1.txt;../out2/1.txt
source_dir= /jade/out/

or

file_path = out/1.txt;out2/1.txt
source_dir= /jade/

instead of the above setting

file_path = /jade/out/1.txt;/jade/out2/1.txt
Example with file_spec

The file_spec option expects a regular expression to select files from the directory which is set by the source_dir option.

In the following first profile filespec transfers all files from /jade/out to /tmp/test/jade/in which names are ending with .txt.

In the second profile recursive the recursive option (default:false) is used to transfer all files from subdirectories of source_dir too which names are ending with .txt.

[filespec]
include = copy_webdav2local
source_dir = /jade/out
file_spec = \.txt$

[recursive]
include = copy_webdav2local
source_dir = /jade/out
file_spec = \.txt$
recursive = true

Example: transfer from local file system to WebDAV server

First we make some global profiles for local to WebDAV transfer.

[local_source_host]
source_protocol=local

[webdav_target_host]
target_protocol=webdav
target_host=http://homer.sos/jade
target_port=80
target_user=test
target_password=12345
target_ssh_auth_method=url
target_dir = /jade/in

[copy_local2webdav]
include = webdav_target_host,local_source_host
operation = copy

The profile copy_local2webdav will be included in further profiles

Please note that the target_dir have to be an absolute path from the viewpoint of the WebDAV server (e.g. DocumentRoot setting in apache).

The target_dir is not relative to the location in which WebDAV is supported.

Example with file_path

These example are similar to above file path example in the WebDAV -> local chapter but in the other direction.

[filepath]
include = copy_local2webdav
file_path = /tmp/test/jade/in/1.txt
Example with file_spec

These examples are similar to above file spec example in the WebDAV -> local chapter but in the other direction.

In the following first profile filespec transfers all files from /tmp/test/jade/out to /jade/in which names are ending with .txt.

In the second profile recursive the recursive option (default:false) is used to transfer all files from subdirectories of source_dir too which names are ending with .txt.

[filespec]
include = copy_local2webdav
source_dir = /tmp/test/jade/out
file_spec = \.txt$

[recursive]
include = copy_local2webdav
source_dir = /tmp/test/jade/out
file_spec = \.txt$
recursive = true

Example: transfer from local file system to WebDAV server behind a Proxy

First we make a global profiles for the proxy parameter.

[proxy]
proxy_host = proxy.sos
proxy_port = 3128
#optional
#proxy_user     = 
#proxy_password =

The profile proxy will be included in other profiles like

[filespec]
include = copy_local2webdav, proxy
source_dir = /tmp/test/jade/out
file_spec = \.txt$

and so you have the above example with file_spec and proxy

  • No labels