<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: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;}
/* 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;}
span.EmailStyle17
        {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" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";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? You’d see it in /var/log/messages
if it happened. <o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";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. If they’re not the same have the script resend and check the md5sum again. 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:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";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. 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. I’m not sure scp does that.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </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:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> ale-bounces@ale.org [mailto:ale-bounces@ale.org]
<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> </o:p></p>
<p class="MsoNormal">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. 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="margin-bottom:12.0pt">- 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="margin-bottom:12.0pt">Which hoses up everything. I usually figure out which file is boogered, re-do the scp by hand, and re-do the import. Then all is well.
<br>
<br>
I am just bumfuzzled as to what would cause this. 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. I'm guessing about 512 or 1K.
<br>
<br>
Neal Rhodes<br>
MNOP Ltd<o:p></o:p></p>
</div>
</body>
</html>