itconsultant
22nd October 2002, 06:50
We are using BaaN IV on HP.There is a session to do automatic ftp to a Windows 2000 server using unix commands (and shell in the BaaN script).When the session is run manually it works fine and files are transferred to Win server.When the same session is run in job the file does not get transferred.Does anyone know of this ?
Thanks in advance.
norwim
22nd October 2002, 09:30
Hi there,
"manually" means you enter login and password in dialog?
I remember trying to write a script that does ftp on unix without success because of this reason: password dialog couldn't be done automatically.
What you can do is use the .netrc file. This file is used by ftp to automize filetransfer. "Man netrc" should help, take care of the permissions and empty lines, then it should work fine.
hth
Norbert
itconsultant
22nd October 2002, 15:04
Hi,
"manually" means the user has to press continue button.The username and password are already predefined in the program script.The program already uses .netrc in the script.Thanks anyway.
ssbaan
22nd October 2002, 16:01
In Unix, the ftp has an interactive option (on the run line) to turn off any prompts form the ftp command (see below form man page on ftp for the -i option)
issue the ftp command with this option ftp -i .......
-i Disable interactive prompting by multiple-file commands; see
the prompt command, below. By default, when this
option is not specified, prompting is enabled.
Hope this helps!
hm1974
23rd October 2002, 12:24
Hi,
here is an script example for unix (hp-ux):
ftp -n ${FTP_HOST} <<EOF
user $USER $PASSWD
cd INTERFACES/DATA/EXTR/OUTPUT
binary
put $1
quit
EOF
the -n option disables the prompt for user and passwort.
Greetings
HM
bamnsour
23rd October 2002, 14:47
I think that itconsultant has a different problem.
I had the same problem and could not solve it.
When you run the session that includes all the ftp commands, it works good. When you try to run the same exact session in a Baan job, it does not work. I think few system variables need to be defined in the Baan Script in order for this to run in a job as well.
did anybody encounter such an issue before?
- Bader
ssbaan
24th October 2002, 18:01
WE have been successful in executing ftp scripts from BaaN via a BaaN job. The BaaN job starts our Unix script which sets up the command file and then execute the ftp command as follows:
ftp -n -i -v corp6 < command file name > log file
(corp6 is the dns server name and could be an ip address)
-i turn off interacive prompts
-n turn off automatic logging (we supply id password in command file)
-v verbose (that is why the redirect to a log file - to have any error messages as well as the commands execution to a log file for later review)
This for Unix to Unix or Unix to NT (not sure about NT to somewhere)