- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script to connect FTP Servers
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 12:46 AM
02-15-2007 12:46 AM
I have a list of > 50 FTP Servers. Can you please tell me script to test if ftp
Thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 01:33 AM
02-15-2007 01:33 AM
SolutionSRCFILE=$1
DSTFILE=$2
IPADDR=$3
USERID=$4
PASSWORD=$5
SRCDIR=$6
DSTTYPE=$7
#depending on what parameters are passed in to the relavant copy
# FTP Files from Current Server to IPADD
(
ftp -vin <
quote USER $USRID
quote PASS $PASSWORD
put $SRCDIR/$SRCFILE $DSTFILE
quit
END_SCRIPT
) | grep "226 Transfer complete." > /tmp/ftp$SRCFILE
if [[ -s /tmp/ftp$SRCFILE ]]
then
echo "FTP Completed Sucessfully"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 01:35 AM
02-15-2007 01:35 AM
Re: Script to connect FTP Servers
You could use this:
# cat .connectme
#!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;
for my $host (@ARGV) {
Net::FTP->new($host) or die "Can't connect to $host\n";
}
1;
...run the script passing as many hostnames as you wish. For example;
# ./connectme host1 host2 host3
If a FTP connection can be made, nothing is returned, otherwise a suitable message is written to STDERR.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2007 01:41 AM
02-15-2007 01:41 AM
Re: Script to connect FTP Servers
how about:
#!/usr/bin/sh
while read host
do
echo "bye" |ftp -n $host
if [ $? ]
then
echo "Not Connecting [ $host ]"
else
echo "Connecting [ $host ]"
fi
done < file_of_ips
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 08:11 PM
02-19-2007 08:11 PM
Re: Script to connect FTP Servers
could you please complete the thread by awarding points to helpful answers and summarising the solution for you.
This will help resolution of similar problems in the future.
Please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2007 08:19 PM
02-19-2007 08:19 PM