LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Copying a set of files through CIFS from Linux to Windows 7 to preserve the timestamp (https://www.linuxquestions.org/questions/linux-software-2/copying-a-set-of-files-through-cifs-from-linux-to-windows-7-to-preserve-the-timestamp-4175475071/)

Rupadhya 08-28-2013 04:43 PM

Copying a set of files through CIFS from Linux to Windows 7 to preserve the timestamp
 
Hello All,

I am trying to copy a bunch of files from a Fedora 19 Linux server to a Windows 7 machine. I have successfully set up SAMBA/CIFS to talk from the Linux server to the Windows machine, but it does not replicate the date/time stamps of the files. It looks like it replicates the date/time stamps of the directories.

Info I can see.
$ uname -r
3.11.0-rc7

# rpm -qa| grep samba
samba-libs-4.0.9-1.fc19.i686
samba-common-4.0.9-1.fc19.i686
samba-client-4.0.9-1.fc19.i686
samba-4.0.9-1.fc19.i686

rpm -qa| grep cifs
cifs-utils-6.1-3.fc19.i686



su -
# mkdir /mnt/samba

# mount -t cifs //{IP Address of Windows 7 Machine}c /mnt/samba -o user=raj,password={password},rw,nosetuids,noserverino,noperm,file_mode=0777,vers=2.1

As normal user on linux side.
$ cd /mnt/samba/Users/Resident/Pictures
$ mkdir testdir2
$ scp -v -r -P /run/media/raj/GoflexEXT4/Pictures/* testdir2


It works, but the files have a time/stamp of current date, versus the Linux date.

Regards,

Raj A. Upadhyaya

Rupadhya 08-28-2013 07:31 PM

:rolleyes:Looks like rsync is working. I won't know for awhile, as it takes awhile to copy the stuff.

I am using
rsync -v -r -c -t --progress /run/media/raj/GoflexEXT4/Pictures/* testdir2
instead of
scp -v -r -P /run/media/raj/GoflexEXT4/Pictures/* testdir2

The question I now have is Why does it work?

Regards,

Raj A. Upadhyaya

Rupadhya 08-28-2013 08:33 PM

It looks like it maintains the file/date time stamps for the files, and now the directories have the current time that they were created on Windows. I am kind of stumped.

- Raj


All times are GMT -5. The time now is 03:07 AM.