Using SFTP, timestamps not honored

tsimmons
Posts: 12
Joined: Fri Jul 08, 2005 3:34 pm

Using SFTP, timestamps not honored

Post by tsimmons » Sun Mar 29, 2009 9:56 pm

When connecting using SFTP, the timestamps are not being set properly when uploading. I am connecting with SFTP (Server is running OpenSSH on Windows) and I have the favorite properties set thusly:

Transfer->Files->Keep Modify Time
Upload = Enable
Download = Enable
Server to Server = Enable

Transfer->Files->Keep Create Time
Upload = Enable
Download = Enable
Server to Server = Enable

Downloads appear to work fine. Uploads always get stamped with the current time, not the timestamp of the uploaded file. Both machines are in the same timezone and the favorite's timezone is set in the favorite properties as well.

Here is a log of a transfer ...

[16:40:07] SmartFTP v3.0.1026.8
[16:40:07] Resolving host name "..."
[16:40:07] Connecting to .... Port: 22
[16:40:07] SSH-2.0-OpenSSH_5.2
[16:40:07] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_5.2"
[16:40:07] SSH protocol version reply. Client Id: "SSH-2.0-SmartFTP"
[16:40:09] Computing session key.
[16:40:09] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[16:40:10] Key exchange completed.
[16:40:10] Host Key Algorithm: ssh-rsa
[16:40:10] Client to Server Encryption: aes256-ctr
[16:40:10] Server to Client Encryption: aes256-ctr
[16:40:10] Session MAC: hmac-sha1
[16:40:10] Client to Server Compression: none
[16:40:10] Server to Client Compression: none
[16:40:10] Authentication request. Method: "none"
[16:40:10] Server supported authentications: publickey,password,keyboard-interactive
[16:40:10] Authentication request. Method: "password"
[16:40:10] User authentication successful.
[16:40:11] SSH session established.
[16:40:11] Connected to ...
[16:40:11] RTT: 273.003 ms
[16:40:11] SFTP protocol version 3
[16:40:11] Detected Server Software: OpenSSH
[16:40:27] Resolving path "XXXXXXXXX".
[16:40:27] Path successfully resolved.
[16:40:27] Reading directory "XXXXXXXXX".
[16:40:28] 6797 bytes transferred. (10.8 KB/s) (609 ms)
[16:40:28] Directory listing complete.
[16:40:51] Getting attributes of "XXXXXXXX/testfile.txt".
[16:40:51] Attributes successfully obtained.
[16:40:58] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
[16:41:02] Getting attributes of "XXXXXXXXX/testfile.txt".
[16:41:02] Attributes successfully obtained.

The problem is the localfile testfile.txt has one timestamp, the server file is stamped with the time it was uploaded.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using SFTP, timestamps not honored

Post by mb » Sun Mar 29, 2009 10:05 pm

Please install the latest version:
https://www.smartftp.com/download

And if the problem persists please post the transfer log from the transfer queue. To get it double click the file in the transfer queue before it's processed.

Regards,
Mat
Last edited by mb on Sun Mar 29, 2009 10:07 pm, edited 1 time in total.

tsimmons
Posts: 12
Joined: Fri Jul 08, 2005 3:34 pm

Re: Using SFTP, timestamps not honored

Post by tsimmons » Tue Mar 31, 2009 3:27 am


mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using SFTP, timestamps not honored

Post by mb » Tue Mar 31, 2009 10:36 am

Bug confirmed. Thank you for reporting. A newer version of SmartFTP will include the bug fix.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using SFTP, timestamps not honored

Post by mb » Tue Mar 31, 2009 9:46 pm

The version with the bug fix is now available:
https://www.smartftp.com/download

Regards,
Mat

tsimmons
Posts: 12
Joined: Fri Jul 08, 2005 3:34 pm

Re: Using SFTP, timestamps not honored

Post by tsimmons » Thu Apr 02, 2009 9:05 pm


unicomplex
Posts: 5
Joined: Mon Sep 12, 2011 10:11 pm

Re: Using SFTP, timestamps not honored

Post by unicomplex » Mon Sep 12, 2011 10:39 pm

I'm having the same problem with SmartFTP 4.0.1215.0 when using SFTP (I just upgraded to be able to use SFTP, so there may be something that I missed but when I read this entry I found that my trouble is exactly the same, although my version is newer).

Settings:

Transfer->Files->Keep Modify Time
Upload = Enable
Download = Enable
Server to Server = Enable

Transfer->Files->Keep Create Time
Upload = Enable
Download = Enable
Server to Server = Enable

Downloads keep their modify dates, uploads are forced to the current date.

Also, when I want to overwrite files on the server, but my local copy has an earlier date, nothing is transferred at all. No warning window, no error message or anything. Is this part of the problem, or just a setting that I forgot?

The log:

[00:14:07] Resolving host name "XXXX"
[00:14:07] Connecting to XXX.XXX.XXX.XXX Port: 22
[00:14:08] SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3
[00:14:08] Starting SSH session. Remote Id: "SSH-2.0-OpenSSH_5.8p1 Debian-1ubuntu3"
[00:14:08] SSH protocol version reply. Client Id: SSH-2.0-SmartFTP
[00:14:08] Key Exchange Algorithm: diffie-hellman-group-exchange-sha256
[00:14:08] Server "ssh-rsa" host key fingerprint: XXXXXXXXXX
[00:14:08] Key exchange completed.
[00:14:08] Host Key Algorithm: ssh-rsa
[00:14:08] Client to Server Encryption: aes256-ctr
[00:14:08] Server to Client Encryption: aes256-ctr
[00:14:08] Session MAC: hmac-sha1
[00:14:08] Client to Server Compression: zlib@openssh.com
[00:14:08] Server to Client Compression: zlib@openssh.com
[00:14:08] Requesting service "ssh-userauth".
[00:14:09] RTT: 240.598 ms
[00:14:09] Authentication request. Method: none
[00:14:09] Server supported authentications: publickey,password
[00:14:09] Authentication request. Method: password
[00:14:09] User authentication successful.
[00:14:09] SSH session established.
[00:14:09] Connected to XXXX.
[00:14:09] Detected Server Software: OpenSSH
[00:14:09] Opening channel 0.
[00:14:09] Channel successfully opened (Local=0, Remote=0).
[00:14:09] Requesting subystem "sftp" (Local=0, Remote=0).
[00:14:09] Sending FXP initialization. Protocol version=6.
[00:14:09] SFTP protocol version 3

Now I try to overwrite a file on the server with a local one, but with an older date --> nothing happens
[00:14:55] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.

So in order to be able to transfer it I delete the remote file and upload my local version --> remote version gets its timestamp modified to the current time
[00:15:06] Deleting file "/XXXX/public_html/index.htm".
[00:15:07] File successfully deleted.
[00:15:10] The operation has been added to the Transfer Queue. Check the Transfer Queue for the status.
[00:15:11] Getting attributes of "/XXXX/public_html/index.htm".
[00:15:11] Attributes successfully obtained.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using SFTP, timestamps not honored

Post by mb » Mon Sep 12, 2011 10:55 pm

>Upload keep date
Take a look at the transfer log and post it here. You can get the transfer log by double clicking the file in the transfer queue before the transfer has completed.

>overwrite
When you drag&drop a file to the server and there is already file with the same name, you will see a "file exist/conflict" dialog where you are prompted for the action. Select overwrite and the file will be overwritten.

unicomplex
Posts: 5
Joined: Mon Sep 12, 2011 10:11 pm

Re: Using SFTP, timestamps not honored

Post by unicomplex » Mon Sep 12, 2011 11:24 pm

Transfer log single (new) file:

[01:00:51] Operation Begin
[01:00:51] Resolving path "/srv/www/XXXX/public_html".
[01:00:51] Path successfully resolved to "/srv/www/XXXX/public_html".
[01:00:51] Remote file exist check: "news-05.htm".
[01:00:51] Getting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:51] 2 No such file
[01:00:51] Uploading file to "/srv/www/XXXX/public_html/news-05.htm".
[01:00:51] StartPosition=0, EndPosition=0.
[01:00:51] 35130 bytes transferred. (Unknown/s) (0 ms)
[01:00:51] Closing file handle.
[01:00:52] File successfully transferred.
[01:00:52] Setting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:52] Attributes successfully set.
[01:00:52] Getting attributes of "/srv/www/XXXX/public_html/news-05.htm".
[01:00:52] Attributes successfully obtained.
[01:00:52] Source File Size=35130, Destination File Size=35130
[01:00:52] Operation End

Overwrite:

I checked my settings for "File Exists". It is "Remote Browser --> Use Default Settings". With this setting I won't have to confirm. But as I said, a newer file on the server is never overwritten, and nothing at all happens.

When I switch to "Ask" I can overwrite the file and (WOW!) it even keeps the date on the server. But confirming everything is not what I want. I always want to overwrite any file on the remote server, without the need to confirm. I could put up with a prompt window in case I try to overwrite a newer file but most definitely not for every file.

And now something very odd:

Actually, after switching "Remote Browser --> Use Default Settings" to "Ask" and even back, I tried again to upload a new file, and it kept the file date.

I then closed SmartFTP, I launched it and logged on again, and the problem was there again. Keep modify date doesn't work.

This problem is anything but reproducible for me.

mb
Posts: 12029
Joined: Thu Oct 11, 2001 1:24 pm
Display name: Mat (SmartFTP)
Contact:

Re: Using SFTP, timestamps not honored

Post by mb » Tue Sep 13, 2011 2:26 am

>overwrite
What you are seeing is the expected behavior.

>date
From the log I can see that SmartFTP sets the file time:
[01:00:52] Setting attributes of "/srv/www/XXXX/public_html/news-05.htm".
So I believe the problem must be somewhere else.

Locked