1822784 Members
4199 Online
109645 Solutions
New Discussion юеВ

SFTP timestamp

 
SOLVED
Go to solution
Vijaya Kumar_3
Respected Contributor

SFTP timestamp

Hi all,

I have an issue with SFTP. When I download files using sftp, my timestamp getting changed. Here is the command line i am using,

sftp myuser@hostname:/opt/psoft/logs/* c:\pmo\

Is there a way using sftp to download the files with the same timestamp of the server?

Thanks in advance! I will assign points!

Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
6 REPLIES 6
Muthukumar_5
Honored Contributor
Solution

Re: SFTP timestamp

Try by using -P option with sftp as,

sftp -P myuser@hostname:/opt/psoft/logs/* c:\pmo\

hth.
Easy to suggest when don't know about the problem!
Pedro Cirne
Esteemed Contributor

Re: SFTP timestamp

Hi,

You just have to use the -P flag when you put/get files:

>get -P file_to_get

Enjoy :-)
Steven E. Protter
Exalted Contributor

Re: SFTP timestamp

The -p command parameter works with the scp command to presere permissions.

That's the first thing I'd try. I'd also try the scp command instead of scp because its better suited for these kind of non-interactive file transfers.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Binu_2
Advisor

Re: SFTP timestamp

Hi
-p Preserves modification times, access times, and modes from the original file.

Try this

Thanks
Binu
Vijaya Kumar_3
Respected Contributor

Re: SFTP timestamp

Thank you
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
Vijaya Kumar_3
Respected Contributor

Re: SFTP timestamp

"scp -p" will do the trick
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com