Sponsored Content
Full Discussion: FTP Issue-Help
Top Forums Shell Programming and Scripting FTP Issue-Help Post 302286436 by Tuxidow on Wednesday 11th of February 2009 06:33:42 AM
Old 02-11-2009
FTP Issue-Help

Hi all,
I am trying to transfer files from one server to another. Following is script i wrote for this purpose. It downloads the file to the server which the script is residing and uploads it to the remote server.

Main Script
Code:
#!/bin/bash -x

BOADIR=/ftp/nas1/csg/public/acct/fleet1/outbound
SNDIR=/ftp/nas1/csg/public/acct/austintet/inbound/
RAHULHOME=/home/rahul1
CSGDRPFLDR=/home/ftpora/export/temp
IP="192.168.191.130"
HOST="-i /root/.ssh/id_dsa_noauth 192.168.191.130"

##################################################
sleep 10
cd $BOADIR

su - rahul1 -c  "/usr/bin/scp -p rahul1@ssa001-fe:$CSGDRPFLDR/A900-STEEL* ."

sleep 2
cd $FLEETHOME

mv A900* $BOADIR

su - rahul1 -c "/usr/bin/ssh rahul1@ssa001-fe "cd $CSGDRPFLDR; /bin/rm -f $CSGDRPFLDR/A900-STEEL.test*""

sleep 1

FILES_TO_MOVE=/tmp/baofiles
cat /dev/null > $FILES_TO_MOVE

find $BOADIR -name "A900-STEEL*" -maxdepth 1 -type f > $FILES_TO_MOVE

if [ -s $FILES_TO_MOVE ]
then
./boa.sh
sleep 20
else
echo "No files to move"
exit 0
fi


script that calls ftp command using the expect function-./boa.sh

Code:
set timeout -1
spawn /usr/bin/sftp -b /ftp/nas1/csg/scripts/boaBatchFile tuxidow@ftpaccess.rahul.com
match_max 100000
expect -exact "Connecting to ftpaccess.rahul.com...\r
tuxidow@ftpaccess.rahul.com's password: "
send -- "625XHU14\r"
expect eof


The batch files which tells what to ftp-boaBatchFile

Code:
cd /NEARFAZE
mput /ftp/nas1/csg/public/acct/fleet1/outbound/A900-IRON*
quit

Bu this is not working fine as upon investigation I could find that customer is using ftp…not sftp to receive this file.

Following are the trials i did and the results got

Code:
root@xxxx03 scripts]# telnet ftpaccess.rahul.com 22

Trying 171.161.160.119...

 

[root@xxxx03 scripts]#

 

[root@xxxx03 scripts]# /usr/bin/sftp -b /ftp/nas1/csg/scripts/boaTestFile tuxidow@ftpaccess.rahul.com

Connecting to ftpaccess.rahul.com...


Can anyone suggest a method to troubleshoot this with out changing much of the script. SmilieSmilie if not possible any other alternatives??

Last edited by Tuxidow; 02-11-2009 at 08:49 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

FTP Issue, Help please

folks; when i manually run this script below, it works fine, but when i run it using a scheduler like "autosys" it doesn't work & i get this error: ftp: connect: A remote host refused an attempted connect operation The script: ftp -n XXX.XXX.XXX.XXX <<- eof User Pswd cd xxx/xxxx/xxx... (0 Replies)
Discussion started by: moe2266
0 Replies

2. Shell Programming and Scripting

FTP issue

I have tried to ftp from unix to local window machine. I have taken this piece of code from forum and tried ... #!/bin/ksh #Usage example: ftpscript sanjit.txt C:/citi/readme.txt localFile=$1 remoteFile=$2 ftplog=loglog.log echo "$(date "+%H:%M:%S") - Attempt to FTP $1 to $2" > $ftplog #... (1 Reply)
Discussion started by: u263066
1 Replies

3. Shell Programming and Scripting

ftp issue

I was changing a bit of the existing script and didnt comment the ftp part in it. So, the ftp step executed, but there was no input file. I got the message like this netout: write returned 0? 250 Transfer completed successfully. What does this mean?. Has the ftp replaced the existing... (1 Reply)
Discussion started by: dnat
1 Replies

4. IP Networking

FTP issue

Hello all, FTP times out when I transfer large files. Small files get transffered fine. small files -------- -bash-3.1$ ftp -i cldevoradb01 Connected to cldevoradb01.enterprisenet.org. 220 (vsFTPd 2.0.5) 530 Please login with USER and PASS. 530 Please login with USER and PASS.... (4 Replies)
Discussion started by: luft
4 Replies

5. Shell Programming and Scripting

ftp issue

Hi again, I'm using the following shell script via cron to upload the daily log files from my shell to the web server so we can view them online. But somehow logs get corrupted and i don't know what's issue. I would really appreciate for your help please. Shell Script: ftp.sh #!/bin/sh... (3 Replies)
Discussion started by: user`
3 Replies

6. Red Hat

FTP issue

Hi, I have installed RHEL 5 on Vmware. I have configured a simple FTP. I am able to transfer and receive files from the vmware-RHEL to my desktop on which vmware is installed and vice-versa. But when i try from other machine in the network it fails. (2 Replies)
Discussion started by: chetansingh23
2 Replies

7. UNIX for Advanced & Expert Users

Ftp issue

Hi we are facing an issue on our server our job connects to a target server and pulls the file from a location .But it is taking too much time to do this . Hwne i manully do the ftp it finished in few seconds .but when the jobs is pulling it is taking 30 to 40 min . please see the log... (1 Reply)
Discussion started by: ptappeta
1 Replies

8. Red Hat

FTP issue

Hi everybody, I would like to findout a directory or a file which is located at ftp server by connecting with ftp <ip> by using any other linux utility. I tried with find and locate commands in this manner but didnt work. Please help me. Regards, Mastan (1 Reply)
Discussion started by: mastansaheb
1 Replies

9. IP Networking

Issue with FTP?

HI Guys, Issue:: While doing bye command on ftp, it just hings as below untill you try Ctrl+C 891 bytes received in 0.0017 seconds (526.16 Kbytes/s) ftp> bye 221-You have transferred 0 bytes in 0 files. I too have tried with other commands like, close, disconnect etc but no luck. ... (1 Reply)
Discussion started by: Atp3530
1 Replies

10. Shell Programming and Scripting

Ftp issue

In the automated process. due to space in between banking and critical, the below command is not working in the automated process. Can anyone help it out. If I am putting cd banking critical-Bas" and file get ftp'ed. but not through the below line ftp -m "ftp.com" -d "banking critical-Bas" (4 Replies)
Discussion started by: ramkumar15
4 Replies
ftpcount(1)							   User Commands						       ftpcount(1)

NAME
ftpcount - show current number of users in each FTP Server class SYNOPSIS
ftpcount [-v] [-V] DESCRIPTION
Use the ftpcount command to show the current number of users logged in and the login limit for each FTP Server class defined in the ftpac- cess(4) file. OPTIONS
The ftpcount command supports the following options: -v Display the user counts for FTP Server classes defined in virtual host ftpaccess(4) files. -V Display program copyright and version information, then terminate. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/var/run/ftp.pids-classnames /etc/ftpd/ftpaccess /etc/ftpd/ftpservers ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWftpu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
ftpwho(1), in.ftpd(1M), ftpaccess(4), ftpservers(4), attributes(5) NOTES
For separate class counts to be kept, class names defined in complete virtual host ftpaccess files must be unique. SunOS 5.10 25 Apr 2003 ftpcount(1)
All times are GMT -4. The time now is 09:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy