1

How do I get tar to only include files newer than a certain date? I have tried the following, both of which include older and newer files (today is 2015-07-20):

  • tar -cj -N 2015-07-07 directory | tar -tj | less
  • tar -cj -N 2015-07-25 directory | tar -tj | less
  • tar -cj --newer-mtime=2015-07-25 directory | tar -tj | less
  • tar -cj --newer-mtime=2015-07-25 directory | tar -tj | less works for me. tar --version ? – neuron Jul 20 '15 at 17:42
1

tar -cj --newer-mtime 2015-07-07 directory | tar -tj | less works

If -N is used, tar works on files whose data modification or status change times are newer than the date given.

While --newer-mtime only checks mtime and disregards ctime

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.