The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
xserver problem - hang tanvirscsa SUN Solaris 0 09-28-2007 03:46 PM
how to up the aix machine when the desktop was hang balarajum AIX 7 03-22-2007 06:22 AM
system hang ajay234 Red Hat 1 06-15-2006 11:32 AM
Hang a Process laila63 SuSE 6 06-30-2004 11:57 AM
Help for Linux hang up andysastre Linux 1 09-02-2003 01:03 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-13-2006
rcunn87 rcunn87 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 24
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 (permalink)  
Old 07-13-2006
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
ok, thanks for sharing - that was extremely enlightening!

care to elaborate a bit more [if you do have a question]?
  #3 (permalink)  
Old 07-14-2006
rcunn87 rcunn87 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 24
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 (permalink)  
Old 07-14-2006
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
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 (permalink)  
Old 07-14-2006
rcunn87 rcunn87 is offline
Registered User
  
 

Join Date: Jun 2006
Posts: 24
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
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0