Re: question of tar

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kevin J. Cummings wrote:

While looking at the tar man page, I see the following:

       -N, --after-date DATE, --newer DATE
              only store files newer than DATE

       --newer-mtime DATE
              like --newer, but with a DATE

I didn't like the explanation, so I looked at the info file for tar:

`--after-date=DATE'
`--newer=DATE'
`-N DATE'
     Only store files newer than DATE.

     Acts on files only if their modification or inode-changed times are
     later than DATE.  Use in conjunction with any operation.
   Gurus would say that `--after-date=DATE' (`--newer=DATE', `-N DATE')
tests both the `mtime' (time the contents of the file were last
modified) and `ctime' (time the file's status was last changed: owner,
permissions, etc) fields, while `--newer-mtime=DATE' tests only `mtime'
field.


   To be precise, `--after-date=DATE' (`--newer=DATE', `-N DATE')
checks _both_ `mtime' and `ctime' and processes the file if either one
is more recent than DATE, while `--newer-mtime=DATE' only checks
`mtime' and disregards `ctime'.  Neither uses `atime' (the last time the
contents of the file were looked at).

mtime can never be more recent than ctime unless it is artificially written in the future. Changing mtime is a change to the inode which also forces an update to ctime.

Based on this explantation, it begs the question:

Does it work for you with --newer-mtime=DATE rather than -N DATE which
doesn't do what you want?

A better question is why you wouldn't want to base the copies on ctime. This will catch renamed files with their new names and new files that have been copied into place with a mechanism that preserves an old mtime.

--
  Les Mikesell
   lesmikesell@xxxxxxxxx

--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux