redirect output of FTP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting redirect output of FTP
# 1  
Old 06-22-2005
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 name.

If I run the script the FTP is done (like it should be) but the output does not appear in the logfile. In fact no output is written.

Thanks for any advice!
Best Regards,

Kris
# 2  
Old 06-22-2005
Bug try this

ftp -n -i -v < $com | /bin/tee -a $LOGFILE
# 3  
Old 06-22-2005
Thanks for your help ssk.

But I already tried tee. This time I tried once more with the full command "/bin/tee" but I'm afraid it's not the solution.

My logfile still shows the same content.

Best Regards,

Kris
# 4  
Old 06-23-2005
PHP

Kris,
Can you post the command file and also the exact syntax u r using on command line ?
Let me know what is logged at present or nothing is logged. As I checked this command on Sun & HP on both this is working fine.

Regards,

ssk
# 5  
Old 06-23-2005
Smilie stupid me...

After a good night sleep and a fresh brain I found out that somewhere in the script the directory is switched and as such the logging is working fine. Only that part is put in another logfile (same name other directory)... as the logfile contains only a name and not a full path.

Sorry I bothered you and thanks a lot for your help.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ftp redirect

Hi i want to redirect a list of ftp file to an exsisting file by mls x.txt mylocalfile.txt result of this command corrupt my data on mylocalfile.txt , please help me (2 Replies)
Discussion started by: rezasadeghi
2 Replies

2. Shell Programming and Scripting

Redirect output from terminal

i make a shell script. There has a line wget https://cisofy.com/files/lynis-2.1.0-88394c1affb9e23bd7390098947b3fd4b04e35e8.tar.gzWhen this line execute terminal show some text like this Resolving cisofy.com (cisofy.com)... 149.*.*.* Connecting to cisofy.com (cisofy.com)|149.*.*.*|:4444...... (4 Replies)
Discussion started by: Devils-ey3
4 Replies

3. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

4. 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

5. 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

6. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

7. Shell Programming and Scripting

output redirect

Hi i am compiling a source code by make command. i want to redirect the output of make to a file but at the same time i want to see the output in terminal. how to do this ?. please suggest your idea. thanks in advance. Saravana ---------- Post updated at 05:24 PM ----------... (2 Replies)
Discussion started by: tsaravanan
2 Replies

8. Shell Programming and Scripting

I want to redirect ls of server ftp

Hello, All is in the message, i would want to redirect the ls command in a file but i have problem. In first, i have try this:#!/bin/bash ftp -n << EOF open F3MONTK2SVK-01 user movie "" binary ls > /Users/eric bye EOF but ftp don't want > I try curl -l but i can't enter into... (9 Replies)
Discussion started by: protocomm
9 Replies

9. Shell Programming and Scripting

Redirect Output

Hi, I would like to list files: ls *.hdf But I would like a copy of the output directed to the screen, but also APPENDED to a text file: test.txt I have tried: ls *.hdf | tee test.txt However, that will just write over everything already existing in test.txt. How can I append the... (1 Reply)
Discussion started by: msb65
1 Replies

10. Shell Programming and Scripting

Redirect output

Hi all, I have a script which call a java program, the logging (to log file) in the program is done using log4j. However, as a safety measure, i still choose to direct standard error to another log file as follow /usr/bin/java -classpath ${classpath} -Xmx128m TestingProgram 2>>... (1 Reply)
Discussion started by: mpang_
1 Replies
Login or Register to Ask a Question