<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.32.2">
</HEAD>
<BODY>
Yes.&nbsp; I did institute a check on the receiving end for nulls, and immediate alert notice.&nbsp;&nbsp; <BR>
<BR>
We can see if jumping on it same day finds more clues. <BR>
<BR>
I'm still looking for the crontab entry that initiates the copy.&nbsp; I used to have root access, but....<BR>
<BR>
No, in all instances, the source file is fine, the target file is pooched, and re-doing the scp by hand via my userid works fine. <BR>
<BR>
Yeah, one has to have some judgement on slapping band-aids on things. <BR>
<BR>
<BR>
<BR>
On Mon, 2017-08-07 at 17:40 -0400, Jim Kinney wrote:
<BLOCKQUOTE TYPE=CITE>
    Random thoughts
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    Since this is a low frequency occurance, is it easier to hack a wrapper that just reads the first line and calls an rsync if its full of nulls? Or as otherwise suggested, dump the crap file, pull it again up to X times and then whine in an email about failures of transfers, blah, blah.
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    The hardest thing I have to do is to NOT automate the occasional event when the automation is more than an order of magnitude more time the manual processing of multiple events. Lazy admin not always as good as efficient admin.
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    Hmm. Is the file being generated wrong at the beginning?
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    On Mon, 2017-08-07 at 20:40 +0000, Lightner, Jeffrey wrote:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        For a high quantity of files all at once rsync is definitely the way to go.<BR>
        <BR>
        &nbsp;<BR>
        <BR>
        For the processes we use sftp for they&#8217;re often enough just one or two files at a time (and many are B2B where rsync isn&#8217;t an option) so I usually opt for sftp.&nbsp;&nbsp; <BR>
        <BR>
        &nbsp;<BR>
        <BR>
        For one off quick command line I usually use scp..<BR>
        <BR>
        &nbsp;<BR>
        <BR>
        From the original post I got the impression it was a single file being sent from each server.&nbsp;&nbsp; Rsync can certainly do that but I&#8217;d prefer sftp.&nbsp;&nbsp; <BR>
        <BR>
        &nbsp;<BR>
        <BR>
        Sftp of course is encrypted like rsync over ssh as is scp.<BR>
        <BR>
        &nbsp;<BR>
        <BR>
        &nbsp;<BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        <B>From:</B> Jim Kinney [mailto:jim.kinney@gmail.com] <BR>
        <B>Sent:</B> Monday, August 07, 2017 4:35 PM<BR>
        <B>To:</B> Lightner, Jeffrey; Atlanta Linux Enthusiasts<BR>
        <B>Subject:</B> Re: [ale] very intermittent weird SCP failure?<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        &nbsp;<BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        It's _much_ slower but very accurate - I use rsync over ssh.<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        &nbsp;<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        On Mon, 2017-08-07 at 16:48 +0000, Lightner, Jeffrey wrote:<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        <BLOCKQUOTE TYPE=CITE>
            Any chance the filesystem on the backend server has gone temporarily full around the time you do the scp&#8217;s that have the issue?&nbsp; You&#8217;d see it in /var/log/messages if it happened.&nbsp;&nbsp; <BR>
            <BR>
            &nbsp;<BR>
            <BR>
            One thing you could do to avoid finding this later and manually resending is put your scp inside a script and before the scp run md5sum on the file that is being sent then after the scp run md5sum (via ssh) on the backend server and compare the values.&nbsp; If they&#8217;re not the same have the script resend and check the md5sum again.&nbsp;&nbsp; You could try it multiple times (e.g. 5 with appropriate pauses between attempts) then have it send email to you on last failed attempt.<BR>
            <BR>
            &nbsp;<BR>
            <BR>
            We use sftp/scp fairly heavily here on RHEL5/RHEL6 and I&#8217;ll have to say I&#8217;ve never run into much trouble with the actual file transfers.&nbsp;&nbsp; Having said that I will say I have a preference for sftp usually and it may have its own built in retransmit of packets like the old ftp did.&nbsp;&nbsp; I&#8217;m not sure scp does that.<BR>
            <BR>
            &nbsp;<BR>
            <BR>
            &nbsp;<BR>
            <BR>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        <BLOCKQUOTE TYPE=CITE>
            <B>From:</B><A HREF="mailto:ale-bounces@ale.org">ale-bounces@ale.org</A> [<A HREF="mailto:ale-bounces@ale.org">mailto:ale-bounces@ale.org</A>] <B>On Behalf Of </B>Neal Rhodes<BR>
            <B>Sent:</B> Monday, August 07, 2017 12:08 PM<BR>
            <B>To:</B> Atlanta Linux Enthusiasts<BR>
            <B>Subject:</B> [ale] very intermittent weird SCP failure?<BR>
            <BR>
            <BR>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
        <BLOCKQUOTE TYPE=CITE>
            &nbsp;<BR>
            <BR>
            We have a client running a ----------------------------- application on three linux servers running <BR>
            <BR>
            Linux HDISATBE3 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Apr 11 17:13:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux<BR>
            <BR>
            The two primary event servers accumulate a file of connection/heartbeat activity, and once a week, a crontab job does an SCP of this file to the backend server, which imports these two files to calculate uptime.&nbsp;&nbsp; The respective user has ssh host equivalence, so this proceeds without password challenge. <BR>
            <BR>
            This has worked for about 10 years. <BR>
            <BR>
            Very occasionally, like, once in 3 months, we will find the copied file on the backend server is garbled, to wit: <BR>
            <BR>
            - total size is correct; matches source<BR>
            - the first XXX bytes of the file is NULL characters. <BR>
            <BR>
            Which hoses up everything.&nbsp;&nbsp; I usually figure out which file is boogered, re-do the scp by hand, and re-do the import.&nbsp; Then all is well. <BR>
            <BR>
            I am just bumfuzzled as to what would cause this.&nbsp;&nbsp; It's always on the front of the file. <BR>
            <BR>
            I should check and see exactly how many NULLS, but usually when it happens my hair is on fire.&nbsp;&nbsp; I'm guessing about 512 or 1K. <BR>
            <BR>
            Neal Rhodes<BR>
            MNOP Ltd<BR>
            <BR>
<PRE>
_______________________________________________
Ale mailing list
<A HREF="mailto:Ale@ale.org">Ale@ale.org</A>
<A HREF="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</A>
See JOBS, ANNOUNCE and SCHOOLS lists at
<A HREF="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</A>
</PRE>
        </BLOCKQUOTE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE TYPE=CITE>
<PRE>
-- 
James P. Kinney III
&nbsp;
Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain
&nbsp;
<A HREF="http://heretothereideas.blogspot.com/">http://heretothereideas.blogspot.com/</A>
</PRE>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
-- 
James P. Kinney III

Every time you stop a school, you will have to build a jail. What you
gain at one end you lose at the other. It's like feeding a dog on his
own tail. It won't fatten the dog.
- Speech 11/23/1900 Mark Twain

http://heretothereideas.blogspot.com/
</PRE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
<PRE>
_______________________________________________
Ale mailing list
<A HREF="mailto:Ale@ale.org">Ale@ale.org</A>
<A HREF="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</A>
See JOBS, ANNOUNCE and SCHOOLS lists at
<A HREF="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>