Adding --ignore-failed-read to tar causes "unknown function modifier" error

Your command seems to be perfectly valid and I don't see any typos/mistakes. To be absolutely sure, I just tried it on my VM running under 32 bit Debian 7.1 (wheezy) with stock kernel 3.2.0.4. As I suspected, archive has been created successfuly (the only change was, of course, the name of the source directory). I also checked version of my tar with

tar --version

which gave me following output:

tar (GNU tar) 1.26

First of all, you should check this info. If you get the same (with possible difference in version number) output, that's fine. If not (or version that seems much older), it's possible, that you are using tar, which simply doesn't support this feature.

Also, you can check, if your tar really DOES support mentioned flag. To do this, type into console:

tar --help | grep ignore-failed-read

You should see something like this:

--ignore-failed-read   do not exit with nonzero on unreadable files

If output stays empty, that means this version of tar does not know this flag at all.

See if any of the above helps.


Another option that might work better in this case is --warning=no-file-changed.

tar --warning=no-file-changed -czf backup.tgz dir1 dir2

--warning controls the display of warning messages. You can add no- to the message keyword to suppress it. So in this case no-file-changed suppresses the file-changed warning.

c.f. https://www.gnu.org/software/tar/manual/html_section/tar_27.html

Tags:

Unix

Backup

Tar