Sftp : not able to print the echo statements after the sftp transfer


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Sftp : not able to print the echo statements after the sftp transfer
# 8  
Old 03-28-2013
Thanks all ...

Now I am able to get the echo statement messages...

And there is another problem ...

I am sftp'ng files from remote server to local server. But the timestamps(date also) were replaced with the present time of the local server and in reverse order.

Eg. on remote server
Code:
$ ls -ltr
total 20672
-rw-r--r--   1 john      other      10471630 Mar 19  12:56  file1.txt
-rw-r--r--   1 john      other      45496       Mar 19  13:37  file2.txt
-rw-r--r--   1 john      other      45512        Mar 24 13:42  file3.txt

But after sftping files were replaced with present date and timestamp ..Also files are received in reverse order.But I am looking for the same order as in remote server.
At present I am receiving with below time stamps
Code:
-rw-r--r-- 1 john    users   45512       2013-03-28 03:43 file3.txt
-rw-r--r-- 1 john   users    45496       2013-03-28 03:43 file2.txt
-rw-r--r-- 1 john   users    10471630 2013-03-28 03:43  file1.txt

Could you please help with appropriate command ?

Thanks in advance...

Regards,
J
# 9  
Old 03-28-2013
If you look in the man page and find the section for interactive commands, you may have the option for a -P on the get sub-command that collects permissions and access time.

If not, can you SSH to the server and archive the files with tar? If so you can SFTP the tar files and when extracted, you can preserve modification times then.



Do either of these help?

Robin
This User Gave Thanks to rbatte1 For This Post:
# 10  
Old 03-28-2013
I guess it's better to tar and then sftp the files and then extract the tar file..

Thanks alot rbatte1.....
# 11  
Old 03-28-2013
Well, using get -P would save coding, elapse time and disk space if it is available. Have you checked the man page for SFTP on your system?



Robin
# 12  
Old 03-28-2013
Directories don't really have any dependable order in particular, never did.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Execute a script after SFTP transfer

Hi All, I am having an issue with the script execution. I am having a SFTP process that send files to a location . I want to execute a script once it transfer the file to that location. Right now I am leveraging autosys file watcher to do that. Is there any way like MFT PPA that can execute... (2 Replies)
Discussion started by: arunkumar_mca
2 Replies

2. UNIX for Dummies Questions & Answers

Sftp transfer doing as single row

Hi All, I have a file in windows when I transfer it using sftp it is getting as single line. I tried to do both ascii and binary File: is transfered as Can you please let me know how can do the transfer as same as XML file Thanks, Arun (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

3. UNIX for Dummies Questions & Answers

SFTP File transfer issue

Hi guys, Need a quick and urgent help on below issue. One of our application is try to transfer the file to another host thru sftp process My file is about 1 GB. Job is getting hung while transferring the file. So when I login as sftp and check the file system space is only in MB... (2 Replies)
Discussion started by: Vinoth Kumar G
2 Replies

4. Shell Programming and Scripting

File transfer using SFTP

Hi, I want to a transfer file from remote machine to a local machine using SFTP where both my local and remote machines are Ubuntu machines.So i wanted to write a unix bash script which uses SFTP command to transfer the file from remote to local machine. My remote server is 178.28.30.106. ... (14 Replies)
Discussion started by: shree11
14 Replies

5. Shell Programming and Scripting

Passwordless file transfer using sftp

Hello all, I have a requirement, in which we need to stage a package to Unix remote server in an automation (we cant use ssh key generation) , do u have any idea how we can transfer the package to remote server using sftp .if you have any script plz share it to me (4 Replies)
Discussion started by: Ramji Sundaram
4 Replies

6. UNIX for Dummies Questions & Answers

SFTP transfer does not complete

I am able to connect to a site and start a file transfer via SFTP, but when the file reaches "100%" -- the file does not complete and "stop". The 100% transfer status does not change (obviously), but the timer for SFTP keeps going and will not complete. This also happens when I try to get a file.... (2 Replies)
Discussion started by: loganban
2 Replies

7. Shell Programming and Scripting

SFTP with ASCII file transfer

Hello - I have text file and need to load the data in Oracle through sqlloader. I need to move this file to unix server and load into oracle. When i SFTP(unfortunately i do not have FTP) to unix box, each line is appended with ControlM character... since it is transferring in BINARY... (4 Replies)
Discussion started by: govindts
4 Replies

8. Shell Programming and Scripting

sftp file transfer

hi i am trying to login to remote server using SFTP Protocol and trying to upload a file butit is asking for the password. Note: I am trying to connect to FrontEnd server sftp SFTREGUP1@14.71.26.6 Connecting to 14.71.26.6... Password Authentication Password: Please help (14 Replies)
Discussion started by: Satyak
14 Replies

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

10. Shell Programming and Scripting

SFTP Transfer Across Multiple Servers

Hello everyone, Have a question which I'm not entirely sure about, but will ask anyway. We have three servers (A/B/C), 'A' being the local host, 'B' being a SFTP server on the DMZ, and 'C' being the intended remote host. The task is to transfer file/s from server 'A' to server 'C' via server... (0 Replies)
Discussion started by: Cameron
0 Replies
Login or Register to Ask a Question