Force tar to ignore/skip errors while compressing files?

Solution 1:

Your assumption is correct, "File changed as we read it" is a notice, usually related to files in use (i.e. written to during the creation process) while tar is creating the archive. If consistency is vital, you're better off rsyncing the contents elsewhere i.e.

rsync -avz /my/home/ /somebackupdir/my/home/  # initial sync, followed by 
rsync -avz /my/home/ /somebackupdir/my/home/  # any subsequent sync, repeated
                                              # as often as you feel necessary

This gives you the benefit of having a backup location that will only need to update the diffs before creating the tarball.

Solution 2:

I think the correct answer to your question should be:

Use tar --warning=no-file-changed which will only suppress warnings of kind "%s: file changed as we read it". A general --ignore-failed-read may ignore failures you'd rather like to not ignore.

Tags:

Tar