using find to get newer files into single tar

Use this:

find . -type f  -newer /last_time_file -print0 | tar -czvf backup.tar.gz -T – –null

It will:

deal with files with spaces, newlines, leading dashes, and other funniness
handle an unlimited number of files
won’t repeatedly overwrite your backup.tar.gz like using tar -c with xargs will do when you have a large number of files

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published.