FTP Output


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers FTP Output
# 1  
Old 02-09-2004
FTP Output

Hi all,

I've got the following piece of code which performs my FTP functionality. My issue is that despite the fact that both standard out and standard error out are defined, I still get a single line of output on the screen when I run the script. i.e. it may be:

530 Login incorrect.
553 /home/user/testing/test.sh: A file or directory in the path na
me does not exist.

How can I stop these single line messages from appearing? The code I'm currently using is below:

<code>
/usr/bin/ftp -ivn ${DEST_SERVER} << EOF > ${FTP_LOG} 2>&1
user ${DEST_USER} ${DEST_PWORD}
copylocal
put ${FILE} ${DEST_PATH}${tmpTrimFile}
bye
EOF
</code>

The script is written in KSH

Cheers,
Linden
# 2  
Old 02-10-2004
.....

Last edited by druuna; 05-21-2009 at 10:18 AM..
druuna
# 3  
Old 02-10-2004
Hi drunna,

Thanks very much much for your reply. Unfortunately your suggestion didn't help me - I still got the same response outputted to the screen.

I also tried removing the -v flag from ftp, however, all that did was remove the number at the start of the output.
e.g. "530 Login incorrect." became "Login incorrect."


Can anyone shed some light on this for me?

Cheers,
Linden
# 4  
Old 02-10-2004
I cannot duplicate your results. My output goes to my log file. And the order of redirection did not matter.

I used ksh on hp-ux 11i.

Are you sure that FTP_LOG is set properly?
# 5  
Old 02-10-2004
.....

Last edited by druuna; 05-21-2009 at 10:18 AM..
druuna
# 6  
Old 02-10-2004
This is quite bizarre (or atleast for me anyway). I tried the ftp piece of code in a script by itself and didn't see the output. (i.e. as I want it). Thus, it's not a machine thing.

I also made sure that the log file was being created correctly, and it was. I'm going in for further testing, but I'm quickly running out of ideas.

Any other suggestions?

Cheers,
Linden

OS: AIX
# 7  
Old 02-10-2004
.....

Last edited by druuna; 05-21-2009 at 10:18 AM..
druuna
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute python file, FTP output to another server

Greetings all, We are implementing a new tool called URLwatch which is a python utility. Here are the requirements. 1) Run every 10 seconds 2) Execute the python script 3) Output file gets generated, FTP it to a differernt server I gave no idea how to do this and management needs a demo... (3 Replies)
Discussion started by: jeffs42885
3 Replies

2. Shell Programming and Scripting

How to redirect the output of a command inside ftp block?

hi, i am using ftp to get files from remote server. inside the ftp i want to us ls -ltr command and send the output of it to a file. ftp -n remote_server <<_FTP quote USER username quote PASS password prompt noprompt pwd ls -ltr get s1.txt bye _FTP i... (4 Replies)
Discussion started by: Little
4 Replies

3. Shell Programming and Scripting

How to redirect output of a command to a variable during ftp mode?

Hi, How can I redirect the output of a following command to a variable. ftp myservername ftp> user (username) guptaji 331 Password required for guptaji. Password: ftp> size /home/salil/abc.dat ftp> a='size /home/salil/abc.dat' ?Invalid command I want to redirect value of size to... (1 Reply)
Discussion started by: Salil Gupta
1 Replies

4. UNIX for Advanced & Expert Users

Not logging ftp connections in /var/adm/wtmpx file (in last command output)

Hi all, I have F5 load balancer on my system and checking service status by opening an ftp session in every 30 seconds. These ftp sessions are being logged in /var/adm/wtmpx and filling up the file. when i run the last command most of the output is this ftp session. I was wondering if there is a... (1 Reply)
Discussion started by: cepxat
1 Replies

5. Shell Programming and Scripting

Ftp script to output a directory name

Is there any way to include a directory name before the filename in the ftp session? Here is the script. DIRECTORY=`cat directory.txt|sed '/^$/d'` ( exec 4>&1 ftp -n>&4 2>&4|& print -p open $host print -p user $user $password print -p binary for D1 in... (0 Replies)
Discussion started by: ranjanp
0 Replies

6. Shell Programming and Scripting

rsh to many hosts the ftp output to single host

Hi guys. i need some help, i need to create a script in tcsh that rsh into all my hosts that we have at our business, then cd to a directory (cd /apps/users) then grab a file from the users folder and ftp it back to my windows machine. can someone please help? Kind regards. Brian Behrens (2 Replies)
Discussion started by: brian112
2 Replies

7. Shell Programming and Scripting

FTP stores unwanted chars to output file

I want to only store date of all files. However, the below script also store unwanted FTP related lines to output file. Could someone tell me how to ignore them (see output first 6 lines)? Thanks #Defining variables and assigning values USR='admin' PASSWD='abc'... (3 Replies)
Discussion started by: dipeshvshah
3 Replies

8. Shell Programming and Scripting

passing parameter to ftp script from output of another ftp

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

9. Linux

Output to 1 file from two files in FTP

I am currently in FTP. I want to transfer two files and need the out put in One file. Can you help me.... For eg: if i am doing mget from 1 server to other. (1 Reply)
Discussion started by: manish.s
1 Replies

10. Shell Programming and Scripting

redirect output of FTP

Hi, I call the FTP command from within a script. The call to FTP looks like this : ftp -n -i -v < $com >> "$logfile" Where $com is a commandfile and I want the output to be redirected to $logfile. If I do this call at the prompt it works perfect. (replacing the variables by there... (4 Replies)
Discussion started by: kcaluwae
4 Replies
Login or Register to Ask a Question