...
Code Block | ||||
---|---|---|---|---|
| ||||
[protocol_fragment_ftp@ftp_demo_sos-berlin] protocol = ftp host = test.sos-berlin.com user = demo password = demo [ftp_server_2_local] operation = copy source_include = protocol_fragment_ftp@ftp_demo_sos-berlin file_spec = .* source_dir = ./ target_protocol = local target_dir = ${USERPROFILE}\jade_demo\a |
Running the configuration
The simple configuration described above is started from the command line or in a batch file on Windows systems using one of the following calls, where sos-berlin_demo_2_local is the name given to the configuration on saving:
...
- It is not necessary to specify a port here as JADE will automatically use the required value of 22 for SFTP unless specified otherwise.
- The new fragment will be addressed with the sftp_demo_sos-berlin_passname attribute.
- The Password element is not a direct descendant of the Authentication element as was the case with FTP - this allows the use of an alternative authentication method (key pair authentication, described in the Public / Private Key Authentication tutorial)
Profile element
...
- generate the new Profile by duplicating the ftp_server_2_local element using the XML Editor's Copy and Paste functions, which are available using the XML Editor's context menu.,
- delete the FTPFragmentRef element and add a new SFTPFragmentRef element,
- select the SFTPFragment as the value for the ref attribute of the SFTPFragmentRef element.
The completed The we second profile in our examples settings file, sftp_server_2_local_pass, which is quite similar to the ftp_server_2_local profile used in the previous example.
As the new profile name suggests, the SFTP protocol is used in this profile and authentication is by user/password. Key pair authentication is described later in this series of articles.
Example
The profile is included in the jade_settings_windows.ini file as follows:
Code Block | ||
---|---|---|
| ||
[sftp_server_2_local_pass]
;;
operation = copy
;;
source_host = test.sos-berlin.com
source_protocol = sftp
source_ssh_auth_method = password
source_port = 22
source_user = demo
source_password = demo
source_dir = /
;;
target_host = localhost
target_protocol = local
target_dir = ${USERPROFILE}\jade_demo\a |
profile is shown below:
Running the configuration
The profile is started from a Windows system by entering the following at Then call this profile by entering the following in the Windows command line:
Code Block | ||
---|---|---|
| ||
jade.cmd -settings="%USERPROFILE%\jade_demo\jade_settings.inisos-berlin_demo_2_local.xml" -profile="sftp_server_2_local_pass" |
...
As with the FTP transfer profile, JADE will log onto the remote server and download all the files in the source_dir folder before stopping. Again, six files will be downloaded.