counting shell args
Just a note responding to your comment about this being for backing up windows boxes. I back up ours with a script that does it in steps testing for errors along the way. ping winbox
mount winbox /mnt/winbox
rsync /mnt/winbox user@remotebox
this doesn't compress but does give me a lot of error checking. The remote box in my case is a Solaris box with a big raid and tape jukebox.
If you're interested I'll email you the script.
Quoted 22 lines · Mike Dresser
Quoted 4 lines · Scott Taylor
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?
If it dumps out a zero byte file, as part of the pipe gzip will go gzip it, and it ends up being 20 bytes. As far as smbtar is concerned, that's a valid output, and returns 0 error code. It was easier to put down 25 than figure out if that's 25 bytes or 25 kilobytes.
If it's a zero return code, AND the file is over 25(k), then the script rotates the backups, otherwise reports via email that there was a backup failure on that particular machine. Once in awhile I'll get one of those partial backups, and that's what the previous full daily backups are for.
If i get two or so in a row, I go hunting down why the machine is failing(is it just turned off, is the ethernet unplugged AGAIN, did the hard drive die last Friday and the user hasn't called me after 4 days to tell me their computer is broken?)
Quoted 9 lines
Are we still on topic? :D
Mike
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! http://channels.netscape.com/ns/browsers/download.jsp
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
Quoted 8 lines · On Mon, 16 Dec 2002 [email protected] wrote:
Just a note responding to your comment about this being for backing up windows boxes. I back up ours with a script that does it in steps testing for errors along the way. ping winbox
mount winbox/mnt/winbox
rsync/mnt/winboxuser@remoteboxthis doesn't compress but does give me a lot of error checking. The remote box in my case is a Solaris box with a big raid and tape jukebox.
If you're interested I'll email you the script.
I looked into using mount(smbmount), but ran into problems with smbmount not keeping track properly of just how many files there are on a filesystem. Been a problem ever since Samba 1.9.something at the minimum.
do 3 ls -alR's in a row, and it'll come up with different numbers each time.
Even more odd than smbtar. :)
Mike