Uploading files to remote Windows server - Modified timestamps

Bug #73452 reported by andrewm on 2006-11-27
22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
Low
Unassigned

Bug Description

Binary package hint: samba

Hello,

When I upload a file to a remote Windows share from either Ubuntu Dapper, Edgy or Feisty (running on VMware) the "last modified" timestamp on the file created on the Windows share is changed to the current time.

This happens whether I use Nautilus to upload to the share or I mount it using smbmount and the console cp command. cp -p does not appear to work and returns an error.

This bug is very annoying because if I want to backup some photos or other files by uploading it to a remote Windows share they will have their original timestamps wiped out, causing the loss of valuable data that could make the image vastly easier to find later.

Users are given no warning that their timestamps will be unnecessarily destroyed either. This behaviour does not exist when uploading a file from a Windows machine.

Files downloaded from a Windows share still have their original timestamps intact. Only uploaded files seem to be effected.

Here is an example using a share mounted with smbmount.

root@jabiru-ubuntu:/home/andrew# cp -fv ./Desktop/testdocument /mnt/tmpsmbfs/testdocument && cp -fv /mnt/tmpsmbfs/testdocument ./Desktop/resultdocument && ls -la ./Desktop/testdocument && ls -la /mnt/tmpsmbfs/testdocument && ls -la ./Desktop/resultdocument
`./Desktop/testdocument' -> `/mnt/tmpsmbfs/testdocument'
`/mnt/tmpsmbfs/testdocument' -> `./Desktop/resultdocument'
-rw------- 1 andrew andrew 0 2006-11-27 21:55 ./Desktop/testdocument
-rwxr-xr-x 1 root root 0 2006-11-27 22:01 /mnt/tmpsmbfs/testdocument
-rwxr-xr-x 1 root root 0 2006-11-27 22:01 ./Desktop/resultdocument

root@jabiru-ubuntu:/home/andrew# cp -fpv ./Desktop/testdocument /mnt/tmpsmbfs/testdocument && cp -fpv /mnt/tmpsmbfs/testdocument ./Desktop/resultdocument && ls -la ./Desktop/testdocument && ls -la /mnt/tmpsmbfs/testdocument && ls -la ./Desktop/resultdocument
`./Desktop/testdocument' -> `/mnt/tmpsmbfs/testdocument'
cp: failed to preserve ownership for `/mnt/tmpsmbfs/testdocument': Operation not permitted

Thank you for your time.

christoph (christophs) wrote :

I think this is the same as bug #122302 because when I asked on the #samba channel I was told
that the client has to care about setting the correct modified time.
So it is (in my opinion) no bug in the server (windows or samba), but in the linux clients (smbcilent, smbmount, nautilus.

My first comment :)

Mathias Gug (mathiaz) on 2007-06-28
Changed in samba:
importance: Undecided → Low
status: New → Confirmed
eduif (eduif) wrote :

Today, one year later I also find this problem. Not only on Kubuntu 6.10 in a virtual machine under Windows XP (using Windows XP share to upload files to), but also when my fedora 4 server backups files to a NAS (that has windows shares).

I agree that the problem is probably somewhere in the samba client.
Has anyone got a solution?

Jan Lillelund (jan-lillelund) wrote :

I am seeing the same on a Ubuntu 9.04 on CIFS mounts using the latest "smbfs" package. Using Microsofts robocopy /MIR as well as ms' file manager preserves timestamps on the server, while rsync and Nautilus doesn't from an Ubuntu 9.04.

Issuing an rsync -a command (trying to maintain file attributes) fails miserably with an error:

rsync: failed to set times on "/mnt/smb100disk2/backup/CR-LD100/.88RC6907010.pdf.p1pkDD": Operation not permitted (1)
...
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1058) [sender=3.0.5]

Is there a solution yet for this problem? Losing file attributes including time information on CIFS shares limits Ubuntu's usability in a professional environment tremendously. We have several TB of data stored on Linux-based CIFS servers and are attempting to move from MS to Ubuntu on a number of clients, but this is so far a showstopper.

Does anybody know of another tool (other than rsync) that supports CIFS correctly on the Ubuntu client?

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

Duplicates of this bug

Other bug subscribers