Ftp hang


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Ftp hang
# 1  
Old 07-13-2006
Ftp hang

Im making a script that goes out to about 200 servers and grabs log files daily and need to make sure the script gets all the servers it can even if one is out. I am ftp'ing the files over but if i cant connect to the server the process looks like it dies and the script is finished.
# 2  
Old 07-13-2006
ok, thanks for sharing - that was extremely enlightening!

care to elaborate a bit more [if you do have a question]?
# 3  
Old 07-14-2006
i felt like i was leaving something out. I need it so it doesnt fail or if the ftp does the script moves on and goes to the other servers
# 4  
Old 07-14-2006
Quote:
Originally Posted by rcunn87
i felt like i was leaving something out. I need it so it doesnt fail or if the ftp does the script moves on and goes to the other servers
You still are.
What're leaving out is the 'succinct' and the 'clear' description of what you're facing with some sample code of yours indetifying the place where you're facing problems.
# 5  
Old 07-14-2006
Code:
getInfraFiles()
{
	cd Infra/$DAY
	logTime
		FILE_COUNT=$(/bin/ls -1 $ARCHIVE_DIRECTORY | /usr/bin/wc -l | /usr/bin/tr -d ' ')
		if [[ "0" != $FILE_COUNT ]]; then
		rm *
		fi
	logTime
	echo -n "=P$(expr $COUNT + 1)-O$(expr $COUNT + 1),">>$HOMEDIRECTORY/$LOGS
	logTime

	/usr/bin/ftp -i -n -v $LINE <<cmd
		user "$USER" "$PASSWD"

		if cd $INFRAPATH
		then
			binary
			mget *
			bye
		fi

		else
			bye
			echo -n "Didn't Connect,Didn't Connect," >> $HOMEDIRECTORY/$LOGS
		fi	
cmd
}

if this function canot login or find the server the whole script dies
it doesnt just move on like i need it to do
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

ALOM hang

Hi guys, I'm new with solaris. I just received sunfire T2000 server. Problem: ALOM keep hang/stuck/jammed. Steps do before it hang : 1. Connect to T2000 (using RJ45 - DB9 cable) 2. Open putty, connect via serial. 3. Power on the server. 4. Its loading. 5. then, hang. ... (1 Reply)
Discussion started by: rajasraf
1 Replies

2. IP Networking

netstat -a hang

Hi, on our Solaris 10 servers, one day 'netstat -a' command return very slow after TCP output, wait 5 minute on this line - SCTP: Local Address Remote Address Swind Send-Q Rwind Recv-Q StrsI/O State ------------------------------- ------------------------------- ------ ------ ------ ------... (6 Replies)
Discussion started by: ora_dba
6 Replies

3. Shell Programming and Scripting

Hang in linux

Hi guys sorry for my English I am from GREECE and I speak from translator.I have in my school work to hang the program I've done is this encounter the problems is that the meter that I have put on the mistakes does not work (I have not stated anywhere lathi = 0, not to reset the meter at each of... (1 Reply)
Discussion started by: soula
1 Replies

4. AIX

Boot from CD hang

Why is one of my blade hanging and does nothing after trying to boot from CD??? ================== I tried to press 1....JS20 does not support SMS menu Here's what I see after 30 minutes... ------------------------------------------------------------------------------- ... (0 Replies)
Discussion started by: mifch
0 Replies

5. Linux

pthread_join hang on glibc2.5

Hello All, The problem i'm experiencing is with the following code: #include <pthread.h> #include <stdio.h> int main(void) { (void) pthread_join(155555, NULL); printf("done"); return 0; } I'm getting on terminal segmentation fault . System used:... (0 Replies)
Discussion started by: crocodil
0 Replies

6. Solaris

Urgent...FTP unable finish download file, hang half way

Hi all, I have 1 problem in my solaris 8 server. The problem is in every nite that will run a cron job to download file from external ftb server. This crob job starter running find, but after running for 4 minute, that ftp services is hang that, until we need kill this process. My question... (3 Replies)
Discussion started by: foongkt5220
3 Replies

7. Red Hat

system hang

Hello, I am having a HP proliant 350 G3 sever installed wih RedHat linux 9.0 when I enterd using any user(Except root) the server hanged after few seconds, also the folder icons are blacked out and the names of the folder icons are disapper. can any body help me. Ajay (1 Reply)
Discussion started by: ajay234
1 Replies

8. UNIX for Dummies Questions & Answers

Hang linux server :(

All greetings:) I had problem: hangs linux a server, and hangs always on miscellaneous and at various times, for example, can stand about one week, and can and in some minutes after reboot. Tried on a server to put windows 2003, with him problems do not arise. What could it be?:) I from... (4 Replies)
Discussion started by: SDaniel
4 Replies

9. SuSE

Hang a Process

this may be something trivial to many of you, but is there a way to purposely cause a process to hang? (6 Replies)
Discussion started by: laila63
6 Replies

10. Linux

Help for Linux hang up

Hi everybody, i need help regarding my Linux start up.I was trying to configure internet connection with my Red Hat in order to use for Internet,but of no avail and I think I have changed one parameter to activate device during computer start up. Now the problem is during start up and... (1 Reply)
Discussion started by: andysastre
1 Replies
Login or Register to Ask a Question