Write log file for SFTP command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Write log file for SFTP command
# 1  
Old 02-03-2016
Write log file for SFTP command

Hi

I am transferring files to SFTP Server using sftp command(below), and want to write log file of this activity. Can you please advise if i am doing wrong.

Code:
sftp -v -oIdentityFile=/home/bbm_user/bbm/private_open_ssh.ppm umf-sftp@bbm-prod-send.com <<EOF
put $local_path/*.gz $remote_path/
>$log_path/$log_file_name

Thanks in advance.

Last edited by cnrj; 02-03-2016 at 08:12 AM..
# 2  
Old 02-03-2016
That sftp command is incomplete and syntactically incorrect. This might be better:
Code:
sftp -v -oIdentityFile=/home/bbm_user/bbm/private_open_ssh.ppm umf-sftp@bbm-prod-send.com >$log_path/$log_file_name  <<EOF
put $local_path/*.gz $remote_path/
EOF

# 3  
Old 02-03-2016
Thanks Rudic

i want to make this as solved, can someone advise how to do this? i tried finding the tags, but could find it
# 4  
Old 02-03-2016
Up at the top where it says 'tags', click 'edit tags' to edit tags. I will add 'solved' for you.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ksh: How to write the log file simultaneously when .sql file executes by UNIX process

Hello Team- we would like to implement an approach which has to write the log file simultaneously when .sql file is executing by Unix process. At present,it is writing the log file once the process is completed. I've tested the current process with the below approaches and none of them... (1 Reply)
Discussion started by: Hima_B
1 Replies

2. Shell Programming and Scripting

Write whatever error in log file

Hi all, I have export LOG_FILE=$HOME_DIR/error.log sqlplus -s /nolog << EOF whenever sqlerror exit sql.sqlcode @$HOME_DIR/connect.sql whenever sqlerror exit sql.sqlcode @$SQL_FILE EOF can display the sql error in putty, how can I write them into log file ?:( (2 Replies)
Discussion started by: Hscript
2 Replies

3. Shell Programming and Scripting

Need File arrival time(sftp) command

Hi All, I am getting some file through using sftp from another server to my server. I want know the exact file arrival time on my sytem I have tried stat command . it gives me the below details $ stat abc.txt File: `abc.txt Size: 24231 Blocks: 48 IO Block:... (5 Replies)
Discussion started by: aish11
5 Replies

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

5. Shell Programming and Scripting

Display and write in file in one echo command

Hi All, I want to display content on command promt and also write in file. For that iI ahve to write two sentence echo "XXXXXXX" echo "XXXXXXXX" >> 1.txt Is there any way to write in one echo statement (1 Reply)
Discussion started by: vivek1489
1 Replies

6. Shell Programming and Scripting

How to Write sftp through "expect" for file upload ?

Hi Experts , I am new to unix programming please tell me how to write expect and hoe to call it for automated file upload process. help me really ! (0 Replies)
Discussion started by: kulbhushan
0 Replies

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

8. UNIX for Advanced & Expert Users

sftp command for file transfer

hi, I need to sftp a file from one unix system to another unix system. eg: filename is test.txt servername : abc@xyz please give me the sftp command for that. thanks in advance.. mohan.p (2 Replies)
Discussion started by: mohanpadamata
2 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. UNIX for Dummies Questions & Answers

how to write to file using fprintf in find command...

:D I once again am looking through the man pages and am still working on the find command to fully comprehend all its attributes.. i am a little stuck on a problem with how many options to -print there are and the only two I know how to use are printf and -print.. i can not make heads or tails of... (2 Replies)
Discussion started by: moxxx68
2 Replies
Login or Register to Ask a Question