git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: preserving mtime

From
David Brown <git@davidb.org>
Date
Nov 18, 2007, 18:47 UTC
Message-ID
<20071118184724.GA494@old.davidb.org>
In-Reply-To
<46a038f90711180134j411bb9c9uf2476f564f9abb6@mail.gmail.com>
On Sun, Nov 18, 2007 at 10:34:55PM +1300, Martin Langhoff wrote:
Show 6 quoted lines
>I do hope anyone doing those things is _very_ aware that the mtime
>metadata has a specific meaning -- when did this specific file in this
>filesystem last change -- and is used by many tools in that sense. You
>are trying to use it for something else. Lots of things will break.
>
>Like incremental backups, for example.

'mtime' does _not_ have the specific meaning of 'when did this specific file last change'. That is the 'ctime' field. 'mtime' is also updated when a file is modified, but can be changed by the user. Many utilities restore mtime to older values, including tar.

Any competent backup program would use 'ctime' for incremental backups, unless they don't mind missing a vast majority of files on many machines.

The main thing I've seen mess up backup software is if the mtime is set into the future.

However, it will make 'make' very confusing, since it uses the mtime to determine if files are out of date. If moving to an older version of a file causes the file to become older, make won't recompile. This is arguably a defect in make, but that is how it works.

Preserving mtime definitely should not be a default.
David
Previous: Martin LanghoffNext: Martin Langhoff
Message 6 of 14 in “preserving mtime”
  1. Fabrizio PollastriNov 16, 2007
  2. Andreas EricssonNov 16, 2007
  3. Wayne DavisonNov 17, 2007
  4. Mike HommeyNov 18, 2007
  5. Martin LanghoffNov 18, 2007
  6. David BrownNov 18, 2007
  7. Martin LanghoffNov 18, 2007
  8. David BrownNov 18, 2007
  9. Jan HudecNov 18, 2007
  10. Robin RosenbergNov 18, 2007
  11. Johannes SchindelinNov 19, 2007
  12. Jakub NarebskiNov 16, 2007
  13. Junio C HamanoNov 16, 2007
  14. Erik WarendorphNov 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.