From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Taylor Subject: Re: counting shell args Date: Mon, 16 Dec 2002 13:38:40 -0800 Sender: linux-admin-owner@vger.kernel.org Message-ID: <5.1.1.6.0.20021216132151.01c70450@mustang> References: <5.1.1.6.0.20021216125932.01c63ca8@mustang> Mime-Version: 1.0 Return-path: In-Reply-To: List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" Content-Transfer-Encoding: 7bit To: linux-admin@vger.kernel.org At 01:12 PM 12/16/02, Mike Dresser wrote: >On Mon, 16 Dec 2002, Scott Taylor wrote: > >The worst part about writing this backup script of mine was finding the >return status from the previous pipe in the script. > >smbtar -s $pcname -x $share -p $password -u $username -t - -X /win95 >/win98 | gzip -1 > $filename.tar.gz > if [ $PIPESTATUS -eq 0 ] && [ `ls -s $filename.tar.gz | awk > '{print $1}'` -gt 25 ]; then > >$PIPESTATUS was hard to find. That should be very useful to know. :) Now you have me curious (grr...I just got over that) why do you care if there are more than 25 blocks in your zipped file? >All that because smbtar doesn't properly report errors, you have to >check that it did in fact report a zero error return, AND verify it >didn't just dump a 0 byte file cause the machine was unreachable. quite painful. >Even >so, if the Windows PC crashes in the middle of the backup(happens enough >to be annoying!), it'll still think the backup ran just fine, and dump a 0 >status back at you, making the backup incomplete. Even better if the WinThing crashes on a Windows user that uses file names like: "This is my file that has numbers in it from last year end" on a set of subdirectories that make the filename over 250 chars long. Yes, I've seen that! LMAO Just try to recover that from your tar file. Ugly! >Most odd. :D Yes, the SMB/CIFS world is not a perfect world, but just look at what they are trying to perfect. ;0) Scott.