Sftp log

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Sftp log
# 1  
Old 10-19-2017
Sftp log

hi guy

i'd like to konw a method where can i save the output of sftp transation
For Exampl

Code:
sftp myuser@myip << EOF
ls -l Path
EOF

I want to save an a file "ls"
Thanks for all
Regards

Moderator's Comments:
Mod Comment Code tags please

Last edited by jim mcnamara; 10-19-2017 at 08:50 AM..
# 2  
Old 10-19-2017
ls is the name of a command, but OK.
Code:
sftp myuser@myip << EOF 2>&1 > ls
ls -l Path
EOF

# 3  
Old 10-19-2017
First off never use a command name or special character like "ls", "rm", "sftp", "*" (UNIX commands, shell metacharacters) as the name of file. You will not believe the awful problems this can cause, and how hard it is to find and fix.

Use output redirection like this:
Code:
sftp myuser@myip << EOF  > mylogfile.log
ls -l Path
EOF

Scott beat me to it, but was nice about the ls filename problem.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Failure of sftp send to log file

I want to transfer all details of sftp connection into a log file and spawn sftp $PCMSu@$FTP_LOC >> log_file is not working for me. Please suggest how to send the data to a log file that has all information if sftp connection is successful or not? Script that I am using: #!/usr/bin/expect... (7 Replies)
Discussion started by: Geeta Yadav
7 Replies

2. Shell Programming and Scripting

SFTP Scripting and Log capture

Hi All, Need help in below query, appreciate your help. We are changing a FTP process to SFTP ( passwordless SSH ) I had few queries on how to log the transfer details into a log file. ----------------------------------------------------- PUTLOGFILE= /xxx/ftp_log.log FAILPUTLOGFILE=... (0 Replies)
Discussion started by: aadarshtripathi
0 Replies

3. Solaris

Enabling SFTP log on Solaris

Hi Guys, Hope you can shed the light to this issue. I have enabled SFTP logging on Linux this way and it works: But trying this on Solaris it wont work, the ssh goes to maintenance in when checking with svcs. The logs said a syntax error it doesn't recognize "-l" (3 Replies)
Discussion started by: batas
3 Replies

4. Shell Programming and Scripting

Sftp-Script log file

Hi, I would like to handle the each file start and end time of the file transfer using sftp command. Can you please advise. (1 Reply)
Discussion started by: koti_rama
1 Replies

5. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

6. Solaris

xtransfer log on SFTP

Dear all I need a way of logging file transfers on SFTP Solaris 10. We currently use SUNSSH 1.1 (which is a modified version of OPENSSH ??), but it doesn't support logging, newer versions of OPENSSH do. Where can I obtain the new OPENSSH (openssh.org only has source code, I'd prefere... (1 Reply)
Discussion started by: wjones
1 Replies

7. Solaris

SFTP log question

On a Sun Solaris 9 box, how do I know what kind of SFTP server is running? And, if someone sftp'ed a file to my box, where is the log file I can check if the sftp session was a successful one or not? (1 Reply)
Discussion started by: fld2007
1 Replies

8. AIX

sftp log file

Hello. we're using sftp to send 2 files to a remote system. It seems that for every 'good' SFTP entry in the log - it is preceded immediately by an error - generally separated by a single second...but sometimes with the exact same timestamp. any idea why that is? sftp.log: 02/17/09 at... (1 Reply)
Discussion started by: udelalv
1 Replies

9. UNIX for Dummies Questions & Answers

sftp log file

Hi, I am running this command to sftp a file: sftp -o identityfile=/blah/blah/.ssh/key blah@mass019 > log.log I want to write the output to a log file, but for some reason when the sftp errors out the log file is empty. It seems that it writes to the log only if the connection is... (2 Replies)
Discussion started by: queenie680
2 Replies

10. Shell Programming and Scripting

SSH/Sftp log in fail recovery

I am connecting to X number of boxes and using sftp to grab files that need to backed up. the box i am doing it from should have keys set up, but in case something happens and it doesnt i need my script to recover from it and not sit there waiting for a password for 10 min. And i need to log which... (0 Replies)
Discussion started by: rcunn87
0 Replies
Login or Register to Ask a Question