Solved

Samba changing Time Stamp

Posted on 2007-04-11
7
2,080 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 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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 Schröder
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
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.

758 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now