Is there a way to for the tar command to check for new files that are not already in the archive, or those that have been deleted (for good measure)?

1 Answer 1


You could use tar -d to see if local filesystem files are different or missing.

To add new files, just use tar -u to add only files newer than the copy in the archive.

tar -cvf /tmp/backup.tar /home # adds all files
echo Hello > /home/newfile.txt
tar -uvf /tmp/backup.tar /home # adds only newfile.txt
rm /home/newfile.txt
tar -df /tmp/backup.tar /home # gives an error about newfile.txt missing

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.