Skip to content

How to compress only new files in a folder

In the shell using tar, you can compress only files newer then a specific date :)  Suuuuuper handy if you’re passing off files added to a large website to someone who already has an old version of that site.  So, pretty easy, you just run this command:

sudo tar -N ‘2016-12-01 00:00:00‘ -jcvf compressed.tar.bz2 folder

  • The Date (example date is December 1st 2016 midnight)
  • Location for output file
  • Folder to copy
Published inScripting

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *