Solved

Samba changing Time Stamp

Posted on 2007-04-11
7
2,209 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
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

726 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