?
Solved

Samba changing Time Stamp

Posted on 2007-04-11
7
Medium Priority
?
2,575 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
7 Comments
 
LVL 27

Accepted Solution

by:
Nopius earned 2000 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 2000 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

839 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