sftp does not set timestamps

Bug #332646 reported by webograph
94
This bug affects 16 people
Affects Status Importance Assigned to Milestone
gvfs
Expired
Wishlist
gvfs (Ubuntu)
Confirmed
Low
Ubuntu Desktop Bugs

Bug Description

Binary package hint: gvfs

when copying or moving files to a directory mounted over sftp, the time stamps are not preserved.

this affects both hardy and intrepid (in hardy, it was tested with a patched version of nautilus hence that version used to forget timestamps on copy anyway). in both cases, i tested it locally and everything was preserved as it should be.

moreover, when moving, nautilus first displays the correct time stamp and only on refreshing shows the wrong updated one.

as timestamps can be considered considered important information, i suggest this bug be treated as "losing data without notice".

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please answer these questions:

 * Is this reproducible?
 * If so, what specific steps should we take to recreate this bug?

 This will help us to find and resolve the problem.

Changed in gvfs:
assignee: nobody → desktop-bugs
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
webograph (webograph) wrote :

to reproduce the problem in intrepid:

* create a file "a", remember its timestamp
* places -> connect to server, via ssh, to an ssh server (in my case, openssh 4.3p2-5~bpo.1)
* copy the file to folder on the server using nautilus
--> at latest after a refresh, the timestamp on the file will be different from that of the original file

sames goes for moving instead of copying.

Revision history for this message
Sebastien Bacher (seb128) wrote :
summary: - sftp does not set timestampts
+ sftp does not set timestamps
Changed in gvfs (Ubuntu):
status: Incomplete → Triaged
Revision history for this message
Sebastien Bacher (seb128) wrote :

using scp on a command line has a similar issue

Changed in gvfs:
status: Unknown → New
Revision history for this message
Antonis Kanouras (akanouras) wrote :

FWIW, also occurs in Jaunty.

Changed in gvfs:
importance: Unknown → Wishlist
Revision history for this message
Alex N. (a-nox) wrote :

This still happens in Ubuntu Precise. This bug is a serious issue if you want to copy images over sftp and your date information get lost.

Revision history for this message
pva (pieter-valkenburg) wrote :

I also want to note this is a serius bug for timestamp related file synchronisation. (Multi node home directory synchronisation over secure SFTP)

Reproduce:
SFTP already mounted in nautilus (automatic by gigolo)

>cd ~;touch -d '1 May 2012 10:22' test.txt
>stat test.txt
>cp test.txt .gvfs/SFTP on <FQDN>/<PATH>/
>stat .gvfs/<FQDN>/<PATH>/test.tst

all tme staps ar changed (normal behavior cp)

>touch -d '1 May 2012 10:22' .gvfs/SFTP on <FQDN>/<PATH>/test.tst

---> ERROR: touch: setting times of `.gvfs/SFTP on <FQDN>/<PATH>/bug.txt': Operation not supported

Revision history for this message
Alecz20 (alexguzu) wrote :

When using scp, you can give the -p switch that will preserver timestamps.

It would be nice if this would be the default behavior for sftp as well.
Alternatively, a config file for sftp would be acceptable.

I agree about the importance of the issue. Especially with images and videos. If you lose the timestamp... you might lose it forever.

Workaround: copy from command line using the -p parameter (not the -P)

Revision history for this message
david6 (andrew-dowden) wrote :

This was partially fixed in Ubuntu 12.04 LTS (desktop).

Puch / Puill:

If you copy from a remote Ubuntu platform, then the timestamp is preserved. But if you copy too, then only some platforms honour the timestamp (otherwise it is set to 'now' by the receiving platform).

Tested today with full patched Ubuntu 12.04.2 LTS desktop, server, and Ubuntu 13.04 desktop (all 64-bit):

 - Copying from 13.04 desktop to 12.04 desktop ( Ok )
 - Copying from 13.04 desktop to 12.04 server ( timestamp replaced, with 'now' )

 - Copying from 12.04 desktop to 13.04 desktop ( Ok )
 - Copying from 12.04 desktop to 12.04 server ( Ok, but new directories have timestamp of 'now' )

This should be fixed, and be consistent. Either as default behaviour, or from SFTP config. file.

Revision history for this message
david6 (andrew-dowden) wrote :

Repeated testing using Nautilus, and SFTP to server.

Does NOT honour timestamp, for files or directories.

Revision history for this message
david6 (andrew-dowden) wrote :

Able to resolve, using 'scp -rp' at command line.

Unable to resolve from any GUI app, that (in theory) uses SCP or SFTP.

Changed in gvfs:
status: New → Confirmed
Revision history for this message
mprotic (mprotic) wrote :

Sorry I'm an idiot, I changed status to Fix Released while browsing. How the f**k am I alllowed to change this status, anyway ?

Plese revert to Confirmed

Changed in gvfs (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
nesuribe (nesuribe) wrote :

I can confirm this still happens in 14.04, even when copying from 14.04 to another 14.04.

Please revert status to Confirmed

Revision history for this message
Rocko (rockorequin) wrote :

Yes, I can confirm it's still an issue in 16.04 using gvfs:amd64 1.27.4-1ubuntu1. It's almost the seven year anniversary of the bug, too!

Revision history for this message
Michael Dooley (mdooley) wrote :

I can also confirm that this issue still exists in 16.04 using gvfs:amd64
1.28.2-1ubuntu1~16.04.1 Using MATE and Caja to SFTP both to and from server.

Changed in gvfs (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
david6 (andrew-dowden) wrote :

Related, and possible NOT worth raising as its own bug.

Renaming a zero-length (semaphore) file in Nautilus does NOT change its time/date stamp.

Tested/verified today with fully updated Ubuntu 16.04 LTS, and 'Nautilus' ('Files' v3.14.3).

Revision history for this message
Julian Rüger (jr98) wrote :

I posted a bounty for the underlying gvfs bug:

https://www.bountysource.com/issues/23459433-gvfs-should-set-file-attributes-properly

If you want this fixed, please consider contributing.
Thanks and sorry for spam ;)

Changed in gvfs:
status: Confirmed → Expired
Revision history for this message
Michael Dooley (mdooley) wrote :

I note that this issue does not exist in Ubuntu-MATE 19.10 alpha (September 16, 2019) using gvfs 1.42.0-1ubuntu1 and Caja to SFTP both to and from a server. Files can be copied without changing their timestamps.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.