tags:

views:

415

answers:

2

tar -xvzf $filename.tar.gz || { exit $?; }

Here my scripts would exit with errorCode 141. I am using Fedora Core 6 with tar version 1.15

it wont happen all the time, but more than 70 percent of the time it fails.

+1  A: 

GNU tar only returns a few things, none of them being -141. however, if it's running a subprocess, like gzip, and that process terminates abnormally, it returns that return code.

I'm not sure what the subprocess might have been though. try it with --verbose and see if you get any clues.

Charlie Martin
I changed my scripts to do gunzip $filname.tar.gz ; tar -xvf $filename.taragain its tar that fails with 141
Irfan Zulfiqar
Did you try running it with --verbose, and did you get any clues? tar also runs rmt for remote tapes; an intermittent problem could be a network issue with the tape drives. Knowing what OS you're running might help.
Charlie Martin
Oh, never mind the OS, I see it now.
Charlie Martin
A: 

As a workaround we are now using cpio for archiving, that works fine for us now, although I would want to know why tar is causing this issue, its around for long time, and being used as standard tool for years.

Irfan Zulfiqar