Note: my $file scalar, in the code above, is the filename with its absolute path: /alpha/absolute/path/file1.cfg Here's the problem... When run as a cronjob, it fails once it gets within the while loop, specifically the last line of execution within loop: $scp->put. Yet I have nothing in my log file? Why? I then managed to find something in the unix mail addressed to me(root), which reads:#!/usr/bin/perl use Net::SCP; $scp = Net::SCP->new ( "beta.kanja.gc.au", "guestUser"); $scp->cwd("/beta/path/router/files/") or die $scp->{errstr}; open(rtrList, "/alpha/path/list_of_files.lst"); while(<rtrList>) { chomp; $file = $_; $scp->put("$file") or die $scp->{errstr}; } close(rtrList);
I have looked at line 93 in SCP.pm and I feel I'm in over my head at this point. Your advice would be much appreciated. Thanks in advanced, PapaiYour "cron" job on Alpha /alpha/script_path/fileXfr.pl > /tmp/fileXfr.log 2>$1 produced the following output: open3: exec of scp -pqB /alpha/absolute/path/file1.cfg guestUser@beta. +kanja.gc.au:/beta/path/router/files/file1.cfg failed at /usr/perl5/site_perl/5.6.1/Net/SCP.pm line 93
In reply to scp fails in cronjob - open3 error by papai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |