11-03-2008
need help in ftp
i have a script that ftp a latest file from server ddcapppip01 to host server.Below the script
#!/bin/ksh
cd /ednadtu5/u01/pipe/AMIS_Scripts/tns_interval_analysis/tns_input
rm -f *
REQUIRED_FILETYPE=BINNINGCONV60
ftp -v -n ddcappip01.tu.com << "EOF"
user pipe pipepass
cd /ednpdtu3/u01/pipe/Processed/DCSI/TNS/LP
pwd
FILE=`ls -t ${REQUIRED_FILETYPE}* | sed '1q'`
echo ${FILE}
bye
EOF
--------------------------------------------------------------------------
files in ddcappip01
-rw-r--r-- 1 pipe pipe 95896798 Oct 29 16:31 BINNINGCONV60_29Oct2008.DAT
-rw-r--r-- 1 pipe pipe 95300858 Oct 30 16:31 BINNINGCONV60_30Oct2008.DAT
-rw-r--r-- 1 pipe pipe 81087330 Oct 31 16:31 BINNINGCONV60_31Oct2008.DAT
-rw-r--r-- 1 pipe pipe 30734708 Nov 1 16:30 BINNINGCONV60_01Nov2008.DAT
-rw-r--r-- 1 pipe pipe 114303087 Nov 2 16:31 BINNINGCONV60_02Nov2008.DAT
-------------------------------------------------------------------------
i want to get the latest file . but my script having problem in the below lines:
FILE=`ls -t ${REQUIRED_FILETYPE}* | sed '1q'`
echo ${FILE}
plz help me in this? Below the ouptput of the script:
Connected to ddcappip01.tu.com.
220 ddcappip01 FTP server (Version 4.2 Tue Nov 14 12:49:19 CST 2006) ready.
331 Password required for pipe.
230-Last unsuccessful login: Wed Oct 22 11:49:39 2008 on ftp from mdcadedn07-pers.tu.com
230-Last login: Mon Nov 3 00:55:03 2008 on ftp from mdcadedn05-pers.tu.com
230 User pipe logged in.
250 CWD command successful.
257 "/ednpdtu3/u01/pipe/Processed/DCSI/TNS/LP" is current directory.
?Invalid command
?Invalid command
221 Goodbye.
----------------------------------------------------------------------------------------------------------------------
plz help me in this? Thanks in advance
Last edited by ali560045; 11-04-2008 at 06:30 AM..
10 More Discussions You Might Find Interesting
1. Answers to Frequently Asked Questions
One of our most frequent questions is how to automate ftp transfers. There are several approaches. Since I'm writing this post, we will start with my favorite technique. :)
In Automated FTP task I present a simple example of my ksh co-process technique. And note that later in this thread I... (0 Replies)
Discussion started by: Perderabo
0 Replies
2. Shell Programming and Scripting
Hello,
A couple of times per week, i receive emails notifications when files are available for processing.
Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies
3. UNIX for Advanced & Expert Users
We are transferring file from mainframes to unix, & in FTP process itself we would like to set access rights for
unix machine.
Has anyone used chmod command in association with site command in ftp? How it should be used?
Thanks in advance. (1 Reply)
Discussion started by: videsh77
1 Replies
4. Shell Programming and Scripting
I have the following ftp script to get files from a remote location.
However, on running the script I find that I am not even able to connect to ftp server.
I am able to connect to ftp server using other GUI ftp tools like WS_FTP using the same IP.
IP used here is a dummy IP.
What can go... (3 Replies)
Discussion started by: gram77
3 Replies
5. UNIX for Advanced & Expert Users
Hi,
We have some clients who will place huge files in to one of the remote server.
And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients.
My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies
6. Shell Programming and Scripting
Hi,
I have a ftp script which first gets all the file names and echo's the latest file.
I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is
> Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies
7. Shell Programming and Scripting
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
8. AIX
how to connect to ftp server in passive mode?
ftp server.abc
and how can i see ftp settings, doesn't exist some ftpd.conf
there is some other file where i check the options and configurations of ftp server?
Thanks (3 Replies)
Discussion started by: prpkrk
3 Replies
9. HP-UX
Hello All,
I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir.
rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed.
Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies
10. Solaris
OS: Solaris 9
Configuration /etc/syslog.conf
daemon.debug
/etc/inetd.conf
ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd -A -l -d
Found the ftp.log only generate those entries from other servers/hosts.
Can we trace on all ftp entries either from/to the server?
... (6 Replies)
Discussion started by: KhawHL
6 Replies
System Administration Commands etrn(8)
NAME
etrn - start mail queue run
SYNOPSIS
etrn [-v] server-host [client-hosts]
DESCRIPTION
SMTP's ETRN command allows an SMTP client and server to
interact, giving the server an opportunity to start the pro
cessing of its queues for messages to go to a given host.
This is meant to be used in start-up conditions, as well as
for mail nodes that have transient connections to their ser
vice providers.
The etrn utility initiates an SMTP session with the host
server-host and sends one or more ETRN commands as follows:
If no client-hosts are specified, etrn looks up every host
name for which sendmail(1M) accepts email and, for each
name, sends an ETRN command with that name as the argument.
If any client-hosts are specified, etrn uses each of these
as arguments for successive ETRN commands.
OPTIONS
The following option is supported:
-v The normal mode of operation for etrn is to do all of
its work silently. The -v option makes it verbose,
which causes etrn to display its conversations with
the remote SMTP server.
ENVIRONMENT
No environment variables are used.
FILES
/etc/mail/sendmail.cf sendmail configuration file
SEE ALSO
sendmail(1M), RFC 1985.
CAVEATS
Not all SMTP servers support ETRN.
CREDITS
Leveraged from David Muir Sharnoff's expn.pl script. Chris
tian von Roques added support for args and fixed a couple of
bugs.
AVAILABILITY
The latest version of etrn is available in the contrib
directory of the sendmail distribution through anonymous ftp
at ftp://ftp.sendmail.org/ucb/src/sendmail/.
AUTHOR
John T. Beck <john@beck.org>