Solved

Samba changing Time Stamp

Posted on 2007-04-11
7
2,164 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
Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

 

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

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 demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
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…
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.

860 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