A possible cause for this error is that the tar archive file being generated is also part of files being archived by tar command itself.
For example, consider the following example.
In this case, you are trying to archive into ./backup.tar which is obviously part of . tar command interprets that ./backup.tar is also one of input files, but is being changed during archiving, so throwing the error.
To fix the error, make sure that the output tar file does NOT belong to the file(s) being archived.
Another solution is to use "--ignore-failed-read" option with tar command, which allows tar command to ignore and continue on unreadable files. This may help with getting around the issue.
Subscribe to Ask Xmodulo
Do you want to receive Linux related questions & answers published at Ask Xmodulo? Enter your email address below, and we will deliver our Linux Q&A straight to your email box, for free. Delivery powered by Google Feedburner.
Did you find this tutorial helpful? Then please be generous and support Xmodulo!