LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2014, 07:45 PM   #1
e_james
LQ Newbie
 
Registered: Feb 2006
Posts: 27

Rep: Reputation: 0
Why do some distributions change the file modified date?


I have a netbook running ubuntu 11.04 and a nettop running lubuntu 13.10. When I copy or move a file on a network drive using the netbook, the modified date is preserved. When I do the same thing with the nettop the modified date is changed to the time of copying / moving. I have seen this behaviour before and I thought it was associated with vfat and ntfs partitions but I am now seeing it on my Netgear ReadyNas unit. It is important to me to preserve the modified date and it is therefore a major black mark against linux if I can't fix this problem.

My main work pc is a laptop running Windows XP Pro SP2 and I have other pcs running XP and linux.

Is there a setting somewhere in the linux configuration files that controls this behaviour?
 
Old 05-06-2014, 08:10 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,546
Blog Entries: 28

Rep: Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205Reputation: 6205
This is a complete shot in the dark, but I suspect it has something to do with how the network share and its ownership and permissions are configured.

A quick web search did not turn up much, but it did turn up this: http://www.turnkeylinux.org/forum/su...ng-files-linux
 
Old 05-06-2014, 10:40 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,789

Rep: Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217Reputation: 2217
Are you using command line tools or a GUI file manager to do the copy/move operations? The default action of the cp command does not preserve most attributes, but if "cp" were aliased to "cp -p" then mode, ownership, and timestamps would be preserved. The mv command should always preserve all attributes that can be preserved.

What any particular GUI file manager does is up to the author of that tool, as are the options for changing that behavior.
 
Old 05-10-2014, 09:06 PM   #4
e_james
LQ Newbie
 
Registered: Feb 2006
Posts: 27

Original Poster
Rep: Reputation: 0
Thank you both for your comments. I apologise for not making it clear that I was referring to gui file manager operations.

Last Wednesday night I went to visit a friend and, while he did some further internet searches, I set out to do some tests with various linux iso images on a usb stick. First I booted up lubuntu 12.04 and copied a small file to different local linux and Windows locations. The modified date was preserved. Then I connected to my friend's network and attempted to copy to one of his ntfs drives. As expected, PCManFM was unable to properly discover the Windows shares so I installed Nautilus which made the connection and copied the file. The modified date was preserved! I copied the file back to linux. The modified date was preserved! So I decided to try another distribution. I booted up lubuntu 13.10 and the first surprise was that PCManFM was able to discover the Windows shares. Again when I copied the file to various locations, the modified date was preserved! Meanwhile my friend found this -

http://www.pclinuxos.com/forum/index.php?topic=101923.0

I haven't yet had the time to do any more experiments but I have some ideas about what is happening.

1. The netbook (ubuntu 11.04) connects to Windows shares by auto mounting because it uses Nautilus and that works well.
2. Because the nettop (lubuntu 13.10) uses PCManFM and that doesn't auto mount the Windows shares, I resorted to defining mount points and fstab entries and that's where the changed "modified date" is coming from. I found forum posts that seemed to suggest that ubuntu 12.04 and newer had a problem with auto mounting. Perhaps the authors were misinterpreting the evidence.
3. When I connect to Windows shares using XP, it maintains a record of the shares even when they are no longer valid. It appears that Nautilus somehow negotiates a connection to that list and, once that connection has been made, PCManFM can also use it. I think the connection will survive a linux reboot but not a Windows reboot.

It seems that there is a linux setting which ensures that the file managers will preserve the modified date but it's somewhere in the mounting details. It may take a while but I plan to find and apply the solution. I also plan to post the details here but, since I probably won't understand most of them, it would be helpful if a linux expert could provide an explanation.
 
Old 05-10-2014, 09:24 PM   #5
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
...the file managers will preserve the modified date but it's somewhere in the mounting details...
Nope. There is none.

It is totally up to the application doing the copy.

Even mv CAN change things - if the source is on one filesystem and the destination is on another... and the reason is that in this situation, mv performs the same operation as cp (and in addition, deletes the source).
 
  


Reply

Tags
datetime, file manager


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how can i remove files from a dir but NOT change the dirs modified date? psycroptic Linux - General 4 08-04-2013 10:04 PM
How to change modified date? You_You Linux - Newbie 2 08-26-2009 02:25 AM
change modified date stamp of file B-Boy Linux - Newbie 2 08-21-2008 07:33 AM
shell script to find modified date and last accessed date of any file. parasdua Linux - Newbie 6 04-22-2008 09:59 AM
[bash] Seeing if a file has been modified before/after a date w3stfa11 Programming 7 10-15-2006 06:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration