tar: after

1 
1 6.8 Operating Only on New Files
1 ===============================
1 
1 The '--after-date=DATE' ('--newer=DATE', '-N DATE') option causes 'tar'
1 to only work on files whose data modification or status change times are
1 newer than the DATE given.  If DATE starts with '/' or '.', it is taken
1 to be a file name; the data modification time of that file is used as
1 the date.  If you use this option when creating or appending to an
1 archive, the archive will only include new files.  If you use
1 '--after-date' when extracting an archive, 'tar' will only extract files
1 newer than the DATE you specify.
1 
1    If you only want 'tar' to make the date comparison based on
1 modification of the file's data (rather than status changes), then use
1 the '--newer-mtime=DATE' option.
1 
1    You may use these options with any operation.  Note that these
1 options differ from the '--update' ('-u') operation in that they allow
1 you to specify a particular date against which 'tar' can compare when
1 deciding whether or not to archive the files.
1 
1 '--after-date=DATE'
1 '--newer=DATE'
1 '-N DATE'
1      Only store files newer than DATE.
1 
1      Acts on files only if their data modification or status change
1      times are later than DATE.  Use in conjunction with any operation.
1 
1      If DATE starts with '/' or '.', it is taken to be a file name; the
1      data modification time of that file is used as the date.
1 
1 '--newer-mtime=DATE'
1      Acts like '--after-date', but only looks at data modification
1      times.
1 
1    These options limit 'tar' to operate only on files which have been
1 modified after the date specified.  A file's status is considered to
1 have changed if its contents have been modified, or if its owner,
1 permissions, and so forth, have been changed.  (For more information on
1 how to specify a date, see ⇒Date input formats; remember that the
1 entire date argument must be quoted if it contains any spaces.)
1 
1    Gurus would say that '--after-date' tests both the data modification
1 time ('mtime', the time the contents of the file were last modified) and
1 the status change time ('ctime', the time the file's status was last
1 changed: owner, permissions, etc.) fields, while '--newer-mtime' tests
1 only the 'mtime' field.
1 
1    To be precise, '--after-date' checks _both_ 'mtime' and 'ctime' and
1 processes the file if either one is more recent than DATE, while
1 '--newer-mtime' only checks 'mtime' and disregards 'ctime'.  Neither
1 does it use 'atime' (the last time the contents of the file were looked
1 at).
1 
1    Date specifiers can have embedded spaces.  Because of this, you may
1 need to quote date arguments to keep the shell from parsing them as
1 separate arguments.  For example, the following command will add to the
1 archive all the files modified less than two days ago:
1 
1      $ tar -cf foo.tar --newer-mtime '2 days ago'
1 
1 verbose tutorial::) GNU 'tar' will try to convert the specified date
1 back to its textual representation and compare that with the one given
1 with the option.  If the two dates differ, 'tar' will print a warning
1 saying what date it will use.  This is to help user ensure he is using
1 the right date.  For example:
1 
1      $ tar -c -f archive.tar --after-date='10 days ago' .
1      tar: Option --after-date: Treating date '10 days ago' as 2006-06-11
1      13:19:37.232434
1 
1      *Please Note:* '--after-date' and '--newer-mtime' should not be
1      used for incremental backups.  ⇒Incremental Dumps, for
1      proper way of creating incremental backups.
1