Hi All,
I wrote a small code distribution script for
N-Tier applications, that uses NET::Telnet to do backups
of remote servers before pushing the code, and to explode
the code.tar after it has been pushed. This worked great
for a good long time, but now suddenly, with no changes to
my code, the script is core dumping occasionally during
the backup portion. It doesn't happen on the same server
every time, or even happen at all every time, so I suspected
some kind of timeout problem was causing the core. If any-
one can give me an idea of what might be causing this, I
would be most appreciative. The specific code in question
follows. (Feel free to e-mail responses to
robert.a.flach@mail.sprint.com as well as or instead of
posting them here, if my question is not of general interest)
code snippet
foreach $serv (@servers) {
$ses = new Net::Telnet(-host => "$serv",
-timeout => "1000"
-errmode => sub { wait; } );
$logtxt = "Now telneting to server $serv";
&logit;
$logtxt = "Starting backup process for server $serv";
&logit;
$ses->login($user,$pass);
$hold = $ses->cmd("cd /$settings
6");
$logtxt = "Directory /$settings
6 Entered";
&logit;
@hold = $ses->cmd("tar cvf archives/$settings[0]_${time}_bak.tar $settings[0]");
$logtxt = "Backup File Created:";
&logit;
@hold = $ses->cmd("compress archives/$settings[0]_${time}_bak.tar");
$logtxt = "Backup File Compressed:";
&logit;
$ses->close;
$logtxt = "Backup for Server $serv Complete";
&logit;
$ses->DESTROY;
$logtxt = "Telnet session ended";
&logit;
}
End of Code Snippet
P.S. I couldn't get the brackets to display properly around the numbers on the arrays,
but they are there.