mraguthu
19th April 2007, 23:50
Hi Guys,
Can I write a session to FTP a file from Baan server to other external sever (outside my fire wall) by hard coding the “Username/password/remote server directory”? At present we are doing the same process from our “Operating system ftp process”. T

hank you for all your help.

george7a
20th April 2007, 08:50
Hi,

Have you considered writing a regular FTP script and then let the session activate the script? Or you can use the file.mv.across.hosts() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_directory_file_operations_file_mv_across_hosts)

I hope it helps,

- George

norwim
20th April 2007, 09:17
Hi there,

whereas on windows systems it is very easy to automate ftp by writing the ftp commands into a file and then calling ftp -s:filename, on unix systems it is a little more tricky. As far as I know, on AS400 you are using a unix runtime environment for Baan, so I guess you can use the unix approach for ftp.
One way to automate ftp on unix is to use a file called .netrc, which has to be in the home path of the user starting ftp. Very important is, that this file has the correct r/w permissions, otherways it will not be used. It has to have permission 600, read-/writable only for the owner. In this file you can define ftp sessions on the base of a hostname xxx, including user, passwort and ftp commands to be issued when a ftp connection is started by the user to the machine named xxx. Example:
----.netrc---
machine xxx login username password abcdefg
macdef init
prompt
cd /xyz
lcd /zyx
mget *dat
quit

---.end of .netrc---
^
|--- afair there has to be an empty line as last line

You can either put the ip as xxx or a name, in the latter case you have to make sure that the name and ip are found in /etc/hosts.
Another way to automagically use ftp is kermit, if this program is available on your system.

hth
Norbert

mr_suleyman
20th April 2007, 12:42
Hi Norwim , Is there a logic as your sample on AIX ?

Thanks

norwim
20th April 2007, 12:48
try: man ftp

mr_suleyman
20th April 2007, 16:06
I know ftp command but I wonder that there is a config file like .netrc for each user.
Also I will look at MAn ftp pages.

Thanks

bdittmar
22nd April 2007, 11:43
Hi Guys,
Can I write a session to FTP a file from Baan server to other external sever (outside my fire wall) by hard coding the “Username/password/remote server directory”? At present we are doing the same process from our “Operating system ftp process”. T

hank you for all your help.

Hello,

you can try this way :

#!/bin/bash
# autoftp.sh
lokal_file=/tmp/test1
remote_file=/var/tmp/remote_test1
# create ... /tmp/test1
ftp -n <<EOFTP
open target
user uid4711 password
bin
put $lokal_file $remote_file
quit
EOFTP

or use of RCP !

Regards