...
The example was tested using a Windows system as the remote system from which the file is initially pulled. The example would work without change if the remote system were a UNIX system. The local test system on which the UDM Manager runs is Linux and the test system to which the file is sent using FTP is also Linux.
Panel |
---|
Html bobswift | <pre>
1. set Html bobswift |
---|
echo=yes
2. open Html bobswift |
---|
rmt=192.168.20.47 user=joe pwd=abcdefg port=7887
3. mode Html bobswift |
---|
type=text
4. attrib Html bobswift |
---|
local createop=replace
5. cd Html bobswift |
---|
rmt=C:\tmp\tmp
6. cd Html bobswift |
---|
local=/home/joe/wrk/xmp/dmzFtp
7. copy Html bobswift |
---|
rmt=file.txt.org local=file.txt
8. exec Html bobswift |
---|
local cmd="sh /home/joe/wrk/xmp/dmzFtp/ftp.sh" user=joe pwd=abcdefg port=7887
9. exec Html bobswift |
---|
dev-linux24 cmd="ls /home/joe/tmp" user=joe pwd=abcdefg port=7887
10. quit Html bobswift | <?pre>
|
UDM Script Explanation
- Turns echo on to put the commands into the transaction log.
- Open a connection to the remote UDM server using remote port 7887. The open command assigns the logical name 'rmt' to the remote system at IP address 192.168.20.47 and assigns the logical name local to the system on which the UDM Manager is running. Setting up local is done automatically by UDM for two-party transfers when a second system is not specified.
- Change the transfer mode from binary to text.
- Change the Creation Option attribute for the local server from new to replace. Without this change, existing files cannot be replaced with new copies.
- Change the current directory on the remote Windows system to C:\tmp\tmp. This is the directory from which the file is pulled.
- Change the current directory on the local UNIX system to /home/joe/wrk/xmp/dmzFtp. This is the directory into which the file is pulled.
- Use the UDM copy command to transfer the file from the remote Windows system to the local UNIX system.
- Execute the shell script on the local system to FTP the file to the 2nd system inside the firewall. In this example, the exec command uses the UCMD server running on the local system to execute the shell script just as if it resided on a remote system. The port must be specified on the command if it is set to a value other than the default value.
- Execute the ls command on the remote system to show that the file was copied. In a production environment, a process could be started to do something productive with the transferred file.
- Quit command stops UDM script execution and the UDM script completes.
The shell script sets up and executes FTP commands.
Panel |
---|
Html bobswift | <pre>
ftp -ipnv houston <<FTP_DONE quote USER joe
quote PASS abcdefg
cd /home/joe/tmp
lcd /home/joe/wrk/xmp/dmzFtp
put file.txt file.new.txt
quit
FTP_DONE
exit 0
< /pre>
|
UDM exec Command Parameters
...