Sponsored Content
Top Forums Shell Programming and Scripting Sending a file to 24 Server locations parallely Post 302395817 by vsmeruga on Wednesday 17th of February 2010 07:41:09 AM
Old 02-17-2010
Hi Jgt,

i tried the below script as you suggested. But i am not able to work it out.

When i run the script, It stops at the Message: "FTPing the file from the server". not going further. Please tell me what i am doing wrong.

etluser : 24ftplocations_i.sh
FTPing the file from the server


Script(24ftplocations_i.sh) code is as below:
Code:
#!/usr/bin/ksh
export filename=/grid/PowerCenter/stage/velocity_r3_dev/inbound/ATRPU/filelist.txt
export SOURCE_DIR=/grid/PowerCenter/stage/velocity_r3_dev/inbound/ATRPU
export ICOMS_FTP_TGT_DIR1=/dw/cdrsp/stage/velocity/vmedia/input/ATRPU/ICOM_SERV1
export ICOMS_FTP_TGT_DIR2=/dw/cdrsp/stage/velocity/vmedia/input/ATRPU/ICOM_SERV2
export FILE_MASK="ATRPU_RP_ATU"

ftp_data_file()
{
    
   # local parameters
   local FTP_FUNCTION=$1
   local FILE_NAME=$2
   local FTP_SERVER=$3        			# remote delivery server
   local FTP_USER=$4					# ftp user name
   local FTP_PASS=$5 					# ftp user pwd
   local FTP_TARGET_DIR=$6				# local target file directory
   
	# local variables
   local SOURCE_DIR=${SOURCE_DIR}   
         
	echo "FTPing the file from the server"

   # ftp file from remote server to local informatica server
   ftp -nv ${FTP_SERVER} <<-!!
	user ${FTP_USER} ${FTP_PASS}
	cd ${FTP_TARGET_DIR}
	 ascii
        prompt
	${FTP_FUNCTION} ${FILE_NAME}
	bye
	!!

   co_error_check $? "Failed to ${FTP_FUNCTION} file ${SOURCE_DIR}/${FILE_NAME} to ${FTP_TARGET_DIR}" 		
}

# main function

while IFS="," read ipaddress username password
do

# ftp file from remote server to local server
	cd ${SOURCE_DIR}

ftp_data_file mput ${FILE_MASK}*.csv ${ipaddress} ${username} ${password}   ${ICOMS_FTP_TGT_DIR1}
ftp_data_file mput ${FILE_MASK}*.csv ${ipaddress} ${username} ${password}   ${ICOMS_FTP_TGT_DIR2}
done <$filename[COLOR="#738fbf"]


Last edited by Scott; 02-17-2010 at 10:11 AM.. Reason: Code tags, PLEASE!
 

10 More Discussions You Might Find Interesting

1. Programming

sending file from server to client

hi dear i m very new to socket programing . i need the source code which sends file from server to client . i mean both server n client programe which sends file . can u do this for me please my email id is email id removed regards bilal (1 Reply)
Discussion started by: bilal
1 Replies

2. Solaris

file locations...

Hi Guys, There was a post that I saw here a while ago regarding file system layout and what to put where, which I am unable to find now.. A user here posted a man page that list what each partition should have in it and what it is used for and were you should install custom packages. ie:... (1 Reply)
Discussion started by: Tornado
1 Replies

3. Shell Programming and Scripting

executing 2 or more files inside another file parallely

hi All, i have 3 files file1 file2 file3 these 3 files are shell (KSH) scripts. i want to place all these 3 shell scripts in another file file99 and execute these files simultaneoulsy inside the file99 these 3 files should be present and executed simultaneously when i excute file99 (nohup... (1 Reply)
Discussion started by: dareman123
1 Replies

4. Solaris

Sending a file to a server

Dear Experts, please help i am very much confused here and not getting the right path, actually i want to send a file from client to a server, initially i used mmap() which is failing most of the time so i want to use general IO streams to do that, i can open a file in "rb" mode and read... (1 Reply)
Discussion started by: vin_pll
1 Replies

5. Shell Programming and Scripting

Perl and sending file to server

Hi, I am trying to write some test code for bigger project where my perl script will send file over to server. This is the current SERVER and CLIENT code I have so far. When I type "hi" from client I get hello back from server and like wise I send send command I get respond back the problem... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

6. UNIX for Advanced & Expert Users

Insert Delimiter at fixed locations in a flat file

Hi Can somebody help me with solution for this PLEASE? I have a flat file and need to insert delimiters at fixed positions in all the lines so that I can easily convert into EXCEL with columns defined as per their width. For Example Here is the file { kkjhdhal sdfewss sdtereetyw... (7 Replies)
Discussion started by: jd_mca
7 Replies

7. Shell Programming and Scripting

Perl: Sending file from UNIX server to Windows server

I'm trying to write a Perl script where a file from a UNIX server box connects to a Windows server box and copies that file into the Window box. The main problem I have right now is that whenever I try to connect to the Windows box, the connection is refused. The error message that always pops... (2 Replies)
Discussion started by: kooshi
2 Replies

8. Shell Programming and Scripting

Inserting commas into file at set locations...

Hey everyone. What would be the best method to insert commas (or comma-quotes) into a file at set locations. Every line in the file looks like this: 1234567890123456 123456BIGAUDIODYNAMITE33 123.12 123456 12345678901234MARK E WILLIAMS 123456 The comma's should... (6 Replies)
Discussion started by: Astrocloud
6 Replies

9. UNIX for Dummies Questions & Answers

Edit locations in a file

Hi , I have a file which looks like this source1 LEN predictive 392879 394347 0.955489 + . Name=sa000003.1;ID=sa000003;Alias=sa121751.1; source1 LEN descriptive_1 391082 392878 . . . Parent=sa000003.1;supp_id=.1805.1; ... (3 Replies)
Discussion started by: siya@
3 Replies

10. Web Development

Sending file to WebDav Server

Hi All, I am using a webdav server host name : abc.xyz.com.ak username : user123 password : password123 port : 80 I need to send files stored in my windows system to the server, any idea how to do it. I dont know how to create a url in linux for webdav server using details. (2 Replies)
Discussion started by: prakhar_dubey
2 Replies
qmail-local(8)						      System Manager's Manual						    qmail-local(8)

NAME
qmail-local - deliver or forward a mail message SYNOPSIS
qmail-local [ -nN ] user homedir local dash ext domain sender defaultdelivery DESCRIPTION
qmail-local reads a mail message and delivers it to user by the procedure described in dot-qmail(5). The message's envelope recipient is local@domain. qmail-local records local@domain in a new Delivered-To header field. If exactly the same Delivered-To: local@domain already appears in the header, qmail-local bounces the message, to prevent mail forwarding loops. The message's envelope sender is sender. qmail-local records sender in a new Return-Path header field. homedir is the user's home directory. It must be an absolute directory name. dash and ext identify the .qmaildashext file used by qmail-local; see dot-qmail(5). Normally dash is either empty or a lone hyphen. If it is empty, qmail-local treats a nonexistent .qmailext the same way as an empty .qmailext: namely, following the delivery instructions in defaultdelivery. The standard input for qmail-local must be a seekable file, so that qmail-local can read it more than once. OPTIONS
-n Instead of reading and delivering the message, print a description of the delivery instructions. -N (Default.) Read and deliver the message. EXIT CODES
0 if the delivery is completely successful; nonzero if any delivery instruction failed. Exit code 111 indicates temporary failure. SEE ALSO
dot-qmail(5), envelopes(5), qmail-command(8), qmail-queue(8), qmail-send(8), qmail-lspawn(8) qmail-local(8)
All times are GMT -4. The time now is 05:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy