Hi everyone,
I have a question regarding Net::SFTP.
I am writing a script which will poll a directory on my side for files that need to be transferred to an SFTP server every 5 minutes. I have a configuration file that defines a number of directories, some are FTP servers while some are SFTP, plus some additional information, such as whether to create a new directory remotely etc...
All of that works fine, except for one client who is giving me problems.
Error is:
Couldn't get handle: Permission denied at ftpOut.pl line 147
I have tried sending a file using winSCP and received a permission error there as well - the only way to remove this was to uncheck "preserve timestamps".
So my question is, is there anyway for me to do this using Net::SFTP ?
the script ends here
if (! ($ftp->put($location.$fileName)) )
{
&Logs(":Error:","Could
+ not PUT file $fileName from $location to $ftpHost");
die &SendFailEmail("Error with transferring $fileName to $ftpHost",$no
+tificationEmail);
}
the connection is made here
my $host = $ftpHost;
my %args =
(
user => $userName,
password => $password,
debug => 'true',
ssh_args => [port => 22],
);
if (! ($ftp = Net::SFTP->new($host, %args)) )
{
&Logs(":Error:","Could not log
+in to FTP $location $ftpHost");
die &SendFailEmail("Error with
+ connecting to $ftpHost",$notificationEmail);
}
thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.