Sponsored Content
Full Discussion: Script ftp multiple servers
Top Forums Shell Programming and Scripting Script ftp multiple servers Post 302298273 by Esquizo000 on Tuesday 17th of March 2009 06:16:03 AM
Old 03-17-2009
Script ftp multiple servers

Hi guys , i have 1 problem and no find what is the problem...Smilie, and .netrc is configured and correct permissions...

REMOTE="/home/user"
LISTADO=`cat /root/home/user/LISTADO.txt`
MACHINE=$(echo $i|awk 'FS="|" {print $1}')

for i in $LISTADO
do

ftp $MACHINE <<TER
passive
prompt
cd $REMOTE
mget *.html
bye
TER

done

Thx in advance!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ftp to multiple servers

Hi folks. I am writing a ksh ftp script. The problem is, I need to transfer the files to several different servers. Is there a way to close a connection and move on to the next in one script or do I need to write a separate script for each one? Thanks, kristy (2 Replies)
Discussion started by: kristy
2 Replies

2. Shell Programming and Scripting

login into multiple servers thru script...

I need to login into multiple servers thru a script run couple commands and run find command as root. I only have ssh access to the servers as a user than I can "su" to root. If you have a similar script please post it. Also if you can suggest commands that I should consider please let me know. ... (1 Reply)
Discussion started by: avcert1998
1 Replies

3. Shell Programming and Scripting

Script to SCP a file to multiple servers

Hi All, I am a total noob to the Unix world, and i hope to learn a lot from this wonderful community. Here's my first post and question , i am trying to SCP a file to multiple servers (multiple destinations) through this little script : #!/bin/ksh # copy files # File to be copied... (7 Replies)
Discussion started by: rdlover
7 Replies

4. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

5. Shell Programming and Scripting

login into multiple servers through script is having some problem

Hi Everybody, I am bit new to shell scripting. I need some help in my script. I have to login into 15 servers and check some logs daily. For that I've written one shell script, somewhere it is having some problems. After log into the first server, the script is not going with the next steps.... (6 Replies)
Discussion started by: raghu.iv85
6 Replies

6. Shell Programming and Scripting

Need a script to run on multiple mail servers..

Hello, I am a Unix newbie and I need a script in which I can run a command on multiple servers at work. The command is to start a storage process and I am sick of doing it manually on all servers.. Here's the command: /opt/bss/bin/snmptable -CB -v2c -c P67LzuBm hostname hrStorageTable... (4 Replies)
Discussion started by: kinyyy
4 Replies

7. UNIX for Dummies Questions & Answers

Running the same remote script on multiple servers

Experts, Im trying to remote into a server, run a script that resides on that server and capture the information displayed & store in a local file. I struggled with this yesterday & finally that script is working now. Now, here is a scope creep and the script that I wrote for 1 remote... (2 Replies)
Discussion started by: OMLEELA
2 Replies

8. Shell Programming and Scripting

Need help with script to copy code to multiple servers

Hi, I am new to scripting and i am trying to use below script to copy code to multiple servers and multiple locations on each server. the script is not working or doesnt give any error. Any help is appreciated. basically i want a script to get the code from a location (dir below) and read the... (2 Replies)
Discussion started by: Ron0612
2 Replies

9. Shell Programming and Scripting

Run a script on multiple servers

I need to run a script on a bunch of remote servers. how can this be done without ssh into each individual server and run it its under /sbin/script.sh on each server (1 Reply)
Discussion started by: tdubb123
1 Replies

10. Shell Programming and Scripting

Shell script to ping multiple servers

Hi I did the following script to ping multiple servers, but I keep on receiveing duplicate emails for one server that is down: #!/bin/bash date cat /var/tmp/servers.list | while read output do ping -c 1 "$output" > /dev/null if ; then echo "node $output is up" else ... (10 Replies)
Discussion started by: fretagi
10 Replies
Net::Netrc(3pm) 					 Perl Programmers Reference Guide					   Net::Netrc(3pm)

NAME
Net::Netrc - OO interface to users netrc file SYNOPSIS
use Net::Netrc; $mach = Net::Netrc->lookup('some.machine'); $login = $mach->login; ($login, $password, $account) = $mach->lpa; DESCRIPTION
"Net::Netrc" is a class implementing a simple interface to the .netrc file used as by the ftp program. "Net::Netrc" also implements security checks just like the ftp program, these checks are, first that the .netrc file must be owned by the user and second the ownership permissions should be such that only the owner has read and write access. If these conditions are not met then a warning is output and the .netrc file is not read. THE .netrc FILE The .netrc file contains login and initialization information used by the auto-login process. It resides in the user's home directory. The following tokens are recognized; they may be separated by spaces, tabs, or new-lines: machine name Identify a remote machine name. The auto-login process searches the .netrc file for a machine token that matches the remote machine specified. Once a match is made, the subsequent .netrc tokens are processed, stopping when the end of file is reached or an- other machine or a default token is encountered. default This is the same as machine name except that default matches any name. There can be only one default token, and it must be after all machine tokens. This is normally used as: default login anonymous password user@site thereby giving the user automatic anonymous login to machines not specified in .netrc. login name Identify a user on the remote machine. If this token is present, the auto-login process will initiate a login using the specified name. password string Supply a password. If this token is present, the auto-login process will supply the specified string if the remote server requires a password as part of the login process. account string Supply an additional account password. If this token is present, the auto-login process will supply the specified string if the remote server requires an additional account password. macdef name Define a macro. "Net::Netrc" only parses this field to be compatible with ftp. CONSTRUCTOR
The constructor for a "Net::Netrc" object is not called new as it does not really create a new object. But instead is called "lookup" as this is essentially what it does. lookup ( MACHINE [, LOGIN ]) Lookup and return a reference to the entry for "MACHINE". If "LOGIN" is given then the entry returned will have the given login. If "LOGIN" is not given then the first entry in the .netrc file for "MACHINE" will be returned. If a matching entry cannot be found, and a default entry exists, then a reference to the default entry is returned. If there is no matching entry found and there is no default defined, or no .netrc file is found, then "undef" is returned. METHODS
login () Return the login id for the netrc entry password () Return the password for the netrc entry account () Return the account information for the netrc entry lpa () Return a list of login, password and account information fir the netrc entry AUTHOR
Graham Barr <gbarr@pobox.com> SEE ALSO
Net::Netrc Net::Cmd COPYRIGHT
Copyright (c) 1995-1998 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.3 2013-02-26 Net::Netrc(3pm)
All times are GMT -4. The time now is 03:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy