Solved

Samba changing Time Stamp

Posted on 2007-04-11
7
2,281 Views
Last Modified: 2013-12-05
Running SUSE 9.1, Samba 3, Windows XP Home Workstation.

I store my documents on a Samba 3.0 server and access them with my windows xp home workstations. Problem is the time stamp on all my files have changed to the present time. This seems to have happened when I recently moved files between windows and Samba. I do not seem to be able to stop this happening. I have to confess I have experimented with security settings in the past. Like CHMOD and rw access etc however I don't know how to solve the problem without making it worse.
Does anybody have any tips to stop Samba changing all my dates and times to the present time?????
0
Comment
Question by:lobsiger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 27

Accepted Solution

by:
Nopius earned 500 total points
ID: 18909968
Samba changes time only when you copy/move/modify files. That's good and that's not a Samba bug.

> Does anybody have any tips to stop Samba changing all my dates and times to the present time?
You may turn off 'access time' updates on a filesystem where all your samba files are located.
Just add ',noatime' to the 4th field of /etc/fstab for that partition, that keeps your shares, then reboot.
But it doesn't solve a problem with changing timestamps after 'moving' files, they are always setup to present time unless you use some kind of archive with timestamp preservation (tar, cpio, ...).

Also you may setup time for any file to any date with 'touch' command, read 'man touch' on Linux, for example: touch -t 200704130134 file, time will be 2007-04-13 01:34:00
0
 

Author Comment

by:lobsiger
ID: 18910029
Thanks but I don't understand.. I have copied files from one hard disk to another and all files have had their times and dates re-stamped. How can this be a good thing? Because I have files with the same name in different directories I can no longer find out which ones are up to date and which ones are old files. Is there any way to get the last modified dates back? Thanks
0
 
LVL 27

Assisted Solution

by:Nopius
Nopius earned 500 total points
ID: 18910046
> I have copied files from one hard disk to another and all files have had their times and dates re-stamped. How can this be a good thing?
Because that 'copies' are new files and they have new timestamps.

How did you 'copy' them? Just in Windows Explorer Copy-Paste? Then yes, for Unix timestamps should become current, because file creation time is changed. Copy operation assumes file creation. But not 'move' operation within the same partition (where timestamps should be preserved). I don't know how Windows handles file copying, but for Unix it's OK.

If timestamps are so impotent to you, you should use some kind of file synchronization software just to copy. Or, as I said to use archives with preserved timestamps (yes, pack all files, then unpack in different directory).
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

Author Comment

by:lobsiger
ID: 18910127
Thanks I'm getting the picture I think? I did a copy between 2 physical hard disks suse to suse using
cp -R command.
I wonder is it possible that it may also have something to do with the fact that I changed the system and hardware clock while once playing about with webmin?
Thanks again, Richard
0
 
LVL 27

Expert Comment

by:Nopius
ID: 18910480
'cp -pR' preserves time.

What about your current system clock, you may adjust it with any public ntp server: 'ntpdate 212.122.1.2'. You only need to setup appropriate timezone.
0
 
LVL 16

Expert Comment

by:Hanno P.S.
ID: 21170303
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup Zone:
ACCEPT Nopius's comments {http:#18909968} (and {http:#18910046}) as answer

Any objections should be posted here in the next 4 days. After that time, the question will be closed.
JustUNIX, Experts Exchange Cleanup Volunteer
0
 
LVL 1

Expert Comment

by:Computer101
ID: 21198281
Forced accept.

Computer101
EE Admin
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question