FTP Script error - AIX


 
Thread Tools Search this Thread
Operating Systems AIX FTP Script error - AIX
# 1  
Old 06-24-2011
FTP Script error - AIX

Hi,

I'm trying to create a ftp script so I can make an ftp connection and start upload and download files from/to remote servers.

In this case I want to start a connection (crontab) and transfer files from localserver1 to remoteserver; remoteserver to localserver1; finally from localserver1 to localserver2.

I changed the .netrc file and create the following entry:

Code:
# machine       sample login userid password userpswd
machine (connection to IP address) login (username) password (password)
macdef init
passive
ascii
prompt
cd /pub/in
lcd /home/remoteserver/in
mget *
mdelete *
cd /pub/out
lcd /home/localserver1/out
mput *
bye
cd /home/localserver1/in
rcp * localserver2:/imp
rm *
cd /home/localserver1/out
rm *

Note: My OS is AIX 4.3i, if I start the connection manually it works fine but if I execute the complete script it stops after the connection with the remoteserver is closed and no files are transfer from localserver1 to localserver2.

Can someone help?

Last edited by pludi; 06-24-2011 at 10:25 AM..
# 2  
Old 06-24-2011
This User Gave Thanks to kah00na For This Post:
# 3  
Old 06-26-2011
The .netrc file does not contain script commands. It is a method for providing the username and password for a given machine. There is one line for this purpose for each machine-username combination. See "man .netrc".

Ps. The link in the previous post is good.
# 4  
Old 07-01-2011
Tanks for this tip, I create a script that calls the .netrc procedure with the files transfer fron localserver1 and remoteserver. The ftp transfer from localserver1 to localserver2 comes at the end of the script, now I just have to find a way to get the connection log.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

AIX Forum: FTP from AIX to Mainframe

This discussion thread is an extension to what was discussed in Shell scripting section. Please refer the post for the requirement: Requirement Post - Click Here The whole thread - Click Here I would like to know how I can use NDM to transfer file from AIX to Mainframe and to verify the... (3 Replies)
Discussion started by: TechGyaann
3 Replies

2. Shell Programming and Scripting

Script FTP maintain error handling

Hi, I have ftp script like below How to insert an error handling, If the transfer failed then send mail to me. Actually, I just need the script to send an email if the FTP failed. How to put the email script within FTP script? Thank You Edy (5 Replies)
Discussion started by: edydsuranta
5 Replies

3. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

4. Shell Programming and Scripting

ftp script error

Hi , I was writing a bash script of ftp to transfer the files , rite now I am considering my local server as ftp server and through keygen -ssh I ahve generated the public & private keys , the private key I have kept in the folder named scripts where my all scripts resides and the public key... (6 Replies)
Discussion started by: rahul125
6 Replies

5. AIX

AIX ftp/sftp script monitor to failed logins

Hi All, Any idea on how to write a script on AIX 5.3 to monitor ftp or sftp login failed. Thanks and more power, Itik (2 Replies)
Discussion started by: itik
2 Replies

6. Shell Programming and Scripting

FTP script error in BASH

Hi All, I have a script which is supposed to connect to Windows machine and FTP a file into LINUX. Script is like below #!/usr/bin/sh ParamterFle=${1} //grepping all parameters BossFtpLog=${2} // assigning log file ftp -i -n host_name << EOF user1 password1 cd /drive1/drive2 get... (6 Replies)
Discussion started by: Raamc
6 Replies

7. Shell Programming and Scripting

FTP script error

This question has been answered many times. I tried to use some examples. Here is the error and cannot find the reason. Please help! messages : 40 step1 step2 arcfile1.sh: line 55: syntax error: unexpected end of file :( here is the script: #!/bin/bash DATE=`date +%Y%m%d`... (21 Replies)
Discussion started by: Lenora2009
21 Replies

8. Shell Programming and Scripting

FTP script error

Hi all, I am trying to run a FTP script which would go to diff servers in the environment and get the request logs and I am getting the following error, Please let me know. server1.ou.st.com (to) usage: open host-name Not connected. Local directory now /home/pk960/logs Not connected.... (0 Replies)
Discussion started by: crosairs
0 Replies

9. Shell Programming and Scripting

FTP shell script error caturing

Hello All, Can anyone let me know how to capure errors in shell scripting? n even the error considerations? Like -- - File not found what other errors can occure in that n how those could be captured? Im_new (6 Replies)
Discussion started by: im_new
6 Replies

10. UNIX for Dummies Questions & Answers

Error in execting ftp script

Please find the below script: #!/bin/ksh host='gskprod.xyz.com' USER='gsk' PASSWORD='ahdpw1' remote_dir='gsk_ds' ftp -n "${host}" user $USER $PASSWORD binary cd $remote_dir mget *.txt mdelete *.txt bye It does not recognizes userid and password. It executes... (4 Replies)
Discussion started by: jhmr7
4 Replies
Login or Register to Ask a Question