<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
span.EmailStyle21
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US"><div>Random thoughts</div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Hmm. Is the file being generated wrong at the beginning?</div><div><br></div><div>On Mon, 2017-08-07 at 20:40 +0000, Lightner, Jeffrey wrote:</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">For a high quantity of files all at once rsync is definitely the way to go.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">For the processes we use sftp for they’re often enough just one or two files at a time (and many are B2B where rsync isn’t an option) so I usually opt for sftp.&nbsp;&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">For one off quick command line I usually use scp..<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">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’d prefer sftp.&nbsp;&nbsp;
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Sftp of course is encrypted like rsync over ssh as is scp.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> 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?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal">It's _much_ slower but very accurate - I use rsync over ssh.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
<div>
<p class="MsoNormal">On Mon, 2017-08-07 at 16:48 +0000, Lightner, Jeffrey wrote:<o:p></o:p></p>
</div>
<blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex">
<p class="MsoNormal" style="margin-left:4.8pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">Any chance the filesystem on the backend server has gone temporarily full around the time you do the scp’s that have the issue?&nbsp; You’d
 see it in /var/log/messages if it happened.&nbsp;&nbsp; <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:4.8pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">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’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.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal" style="margin-left:4.8pt"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D">We use sftp/scp fairly heavily here on RHEL5/RHEL6 and I’ll have to say I’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’m not sure scp does that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:4.8pt"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">
</span><a href="mailto:ale-bounces@ale.org"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">ale-bounces@ale.org</span></a><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> [</span><a href="mailto:ale-bounces@ale.org"><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">mailto:ale-bounces@ale.org</span></a><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">]
<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?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal" style="margin-left:4.8pt">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:
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:4.8pt">
- total size is correct; matches source<br>
- the first XXX bytes of the file is NULL characters. <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:12.0pt;margin-left:4.8pt">
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<o:p></o:p></p>
<pre style="margin-left:4.8pt">_______________________________________________<o:p></o:p></pre>
<pre style="margin-left:4.8pt">Ale mailing list<o:p></o:p></pre>
<pre><a href="mailto:Ale@ale.org">Ale@ale.org</a><o:p></o:p></pre>
<pre><a href="http://mail.ale.org/mailman/listinfo/ale">http://mail.ale.org/mailman/listinfo/ale</a><o:p></o:p></pre>
<pre style="margin-left:4.8pt">See JOBS, ANNOUNCE and SCHOOLS lists at<o:p></o:p></pre>
<pre><a href="http://mail.ale.org/mailman/listinfo">http://mail.ale.org/mailman/listinfo</a><o:p></o:p></pre>
</blockquote>
<div>
<pre>-- <o:p></o:p></pre>
<pre>James P. Kinney III<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre>Every time you stop a school, you will have to build a jail. What you<o:p></o:p></pre>
<pre>gain at one end you lose at the other. It's like feeding a dog on his<o:p></o:p></pre>
<pre>own tail. It won't fatten the dog.<o:p></o:p></pre>
<pre>- Speech 11/23/1900 Mark Twain<o:p></o:p></pre>
<pre><o:p>&nbsp;</o:p></pre>
<pre><a href="http://heretothereideas.blogspot.com/">http://heretothereideas.blogspot.com/</a><o:p></o:p></pre>
</div>
</div>


</blockquote><div><span><pre><pre>-- <br></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></span></div></body></html>