Sponsored Content
Top Forums Shell Programming and Scripting automate ftpget to multiple hosts Post 302258017 by huntfishtrap on Thursday 13th of November 2008 04:12:34 PM
Old 11-13-2008
OK, I've made some progress. I figured out how to do a loop though a file of ip addresses to each different host, but I must have my syntax wrong. I get "ftp: host: unkown host". The file has a list of addresses in dotted decimal format. I can ssh to them individually, so I know I have connectivity. Here is my script.

#/usr/bin/bash
# this script goes to each xml store and gets the xml file

for host in /home/paul/xml/xmlstorelist

do

ftp -v -n host << cmd
user username password

# this part finds the newest file
cd /usr/fiscal/data/xmlejrls
set -- *.xml
shift $(( $# - 1 ))
newest_file=$1

get $1

quit
cmd
done


Any help?
Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Copy a file to multiple hosts

Hi, I need to copy a file ( say 1MB file ) to multiple hosts( no of machines is huge). What would be the most optimal way of doing it with minimal user intervention ? Thanks, Sumit (5 Replies)
Discussion started by: sumsriva
5 Replies

2. Shell Programming and Scripting

script for df output from multiple hosts

I am trying get "df -k" output from multiple hosts along with their hostnames via ssh, my script is appending the "df -k" output from all the nodes to a single file but not getting the hostnames for those nodes, just wondering how to pass more than one command via ssh or may be someone could come... (6 Replies)
Discussion started by: barkath
6 Replies

3. Shell Programming and Scripting

script to reboot multiple hosts

Hi Expert, How to create a script to reboot multiple hosts in linux? Thank you. (5 Replies)
Discussion started by: regmaster
5 Replies

4. UNIX for Dummies Questions & Answers

Can you have multiple mailhost's in the /etc/hosts file?

We recently had an smtp server go down and didn't have a backup. Now that the backup server is up and running, I'd like to set up sendmail on our Solaris 10 servers to failover to the backup mail (smtp) server if the primary refuses connections. I've googled "mailhost" and haven't found... (0 Replies)
Discussion started by: the.gooch
0 Replies

5. UNIX for Dummies Questions & Answers

Can you specify multiple mailhost's in the /etc/hosts file?

Hello, This question has been posted by another member previously, but no reply/answer was posted to that thread and it has been closed. Searches do not seem to turn up a straight answer as to whether or not this is possible. So I ask the same question: We recently had our SMTP server go... (2 Replies)
Discussion started by: kwasserb
2 Replies

6. Shell Programming and Scripting

Bash Scripting Help to automate replacing multiple lines

Background: I am writing a script to help me automate tweaks and things I apply to a custom Android rom I developed. I am on the very last part of my script, and I am stuck trying to find the right command to do what I seek. When I build roms from source, a file called updater-script is... (8 Replies)
Discussion started by: Silverlink34
8 Replies

7. Shell Programming and Scripting

Automate multiple commands

Hi, I am trying to count the number of times a string of letters occurs in a file for multiple unique strings of letters. Right now I can do this one at a time using the following code (in this example I am searching for the string "AAA"): echo AAA >> outfile.txt grep -c "AAA" -r... (4 Replies)
Discussion started by: gecko1
4 Replies

8. UNIX for Dummies Questions & Answers

How to search using ssh on multiple hosts?

Hi guys - I am having a hard time trying to figure how to search for a certain string on config files hosted on multiple hosts. This is an example: Hostnames: myhost1.mycompany.com|myhost2.mycompany.com|myhost3.mycompany.com String to search for: myipaddress.somehost.com Directory... (9 Replies)
Discussion started by: DallasT
9 Replies

9. Shell Programming and Scripting

Run a command on multiple hosts

I created a script to check for tsm backup status on linux hosts. Script uses a source file to connect to each host and run a dsmc command on each host and write the output back to a output file located on the parent server where the script is running. The script works fine for the first 2 hosts... (4 Replies)
Discussion started by: svajhala
4 Replies

10. Shell Programming and Scripting

Ssh to multiple hosts and then run multiple for loops under remote session

Hello, I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out. I am specifically facing issues while running for loops. I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies
Net::EPP::Frame::Command::Create::Host(3pm)		User Contributed Perl Documentation	       Net::EPP::Frame::Command::Create::Host(3pm)

NAME
Net::EPP::Frame::Command::Create::Host - an instance of Net::EPP::Frame::Command::Create for host objects. SYNOPSIS
use Net::EPP::Frame::Command::Create::Host; use strict; my $create = Net::EPP::Frame::Command::Create::Host->new; $create->setHost('ns1.example.uk.com); print $create->toString(1); This results in an XML document like this: <?xml version="1.0" encoding="UTF-8"?> <epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"> <command> <create> <host:create xmlns:contact="urn:ietf:params:xml:ns:host-1.0" xsi:schemaLocation="urn:ietf:params:xml:ns:host-1.0 host-1.0.xsd"> <host:name>ns1.example.uk.com</host:name> </domain:create> </create> <clTRID>0cf1b8f7e14547d26f03b7641660c641d9e79f45</clTRIDE> </command> </epp> OBJECT HIERARCHY
L<XML::LibXML::Node> +----L<XML::LibXML::Document> +----L<Net::EPP::Frame> +----L<Net::EPP::Frame::Command> +----L<Net::EPP::Frame::Command::Create> +----L<Net::EPP::Frame::Command::Create::Host> METHODS
my $element = $frame->setHost($host_name); This sets the name of the object to be created. Returns the <<host:name>> element. $frame->setAddr({ 'ip' => '10.0.0.1', 'version' => 'v4' }); This adds an IP address to the host object. EPP supports multiple addresses of different versions. AUTHOR
CentralNic Ltd (http://www.centralnic.com/). United Domains AG (http://www.united-domains.de/) provided the original version of Net::EPP::Frame::Command::Create::Host. COPYRIGHT
This module is (c) 2012 CentralNic Ltd. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
o Net::EPP::Frame perl v5.14.2 2012-04-23 Net::EPP::Frame::Command::Create::Host(3pm)
All times are GMT -4. The time now is 06:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy