Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SFTP Files Timestamp

Tags:

datetime

sftp

We have a client SFTP using which we receive our files. The problem is that their SFTP behaves in a wierd way. All the folder and files in it has the same timestamp, even if the file is posted today it shows timestamp as 01/01/2013

How is this possible?

If i download the same files to my local it shows different timestamp (which i believe is the original timestamp for the files)

enter image description here

The Left side is my local and the right side is SFTP.

Is there any way to identify what are the files that are posted today directly from SFTP, during this conditions(Timestamp not updating).

We are looking for a way to have it automated but not sure how to do it in this scenario

Any help will be much appreciated

like image 308
Sarathi Kamaraj Avatar asked Oct 30 '13 12:10

Sarathi Kamaraj


1 Answers

If you're using a command-line sftp client you can just use the -p configuration flag to preserve timestamps either when starting the sftp client or on download.

For example, doing this downloads all files in a directory and sets their timestamp to now:

sftp> mget *

Using the -p flag preserves the timestamps of the source, however:

sftp> mget -p *

I assume the graphical client you're using has something similar.

like image 79
Sam Critchley Avatar answered Nov 08 '22 19:11

Sam Critchley