Still new to using Perl, any help with this is appreciated.
Code...
#!/usr/bin/perl
# Backup 192.168.0.1 web directory
# to 192.168.0.2 via FTP
# Begin remote transfer of file to ODIN for storage #
use Net::FTP;
$ftp = Net::FTP->new("192.168.0.2", Debug => 1)
or die "Could establish conneciton to
new to perl...
I am recieving errors when trying open an FTP connection.
Code...
#!/usr/bin/perl
# Backup 192.168.0.2 web directory
# to 192.168.0.3 via FTP
# Begin remote transfer of file to 192.168.0.3 for storage #
use Net::FTP;
$ftp = Net::FTP->new("192.168.0.3", Debug => 1)
or die "Could esta
Hi Jas.
Jas wrote:
>
> Still new to using Perl, any help with this is appreciated.
>
> Code...
> #!/usr/bin/perl
> # Backup 192.168.0.1 web directory
> # to 192.168.0.2 via FTP
>
> # Begin remote transfer of file to ODIN for storage #
> use Net::FTP;
> $ftp = Net::FTP->new("192.168.0.2", Debug =>
> Hi Jas.
>
> Jas wrote:
> >
[snip]
>
> > $ftp->put(`../path/to/*-www.tar.gz`)
> > or die "Could not transfer files ", $ftp->message;
>
> .. backticks in two statements!
>
> > $ftp->quit;
> >
> > Error...
> > Net::FTP>>> Net::FTP(2.71)
> > Net::FTP>>> Exporter(5.566)
> > Net::FTP>>> Net::Cm
> Hi Jas.
>
> Jas wrote:
> >
[snip]
>
> > $ftp->put(`../path/to/*-www.tar.gz`)
> > or die "Could not transfer files ", $ftp->message;
>
> .. backticks in two statements!
>
> > $ftp->quit;
> >
> > Error...
> > Net::FTP>>> Net::FTP(2.71)
> > Net::FTP>>> Exporter(5.566)
> > Net::FTP>>> Net::Cm
Wiggins D Anconia wrote:
>
> Rob wrote:
> >
> > The backticks are your problem: they will make Perl shell out to execute
> > the string as a command. The 'sh: line1:' in your error message is the
> > clue. Presumably you don't have execute permission for
> > '../path/to/02192004-www.tar.gz'?
> >
>
That worked like a charm. Thanks again...
Wiggins D Anconia wrote:
Hi Jas.
Jas wrote:
[snip]
$ftp->put(`../path/to/*-www.tar.gz`)
or die "Could not transfer files ", $ftp->message;
.. backticks in two statements!
$ftp->quit;
Error...
Net::FTP>>> Net::FTP(2.71)
Net::FTP>>> Exporter(5.566)
Ok, I am getting frustrated with this... Any help is appreciated.
[FTP Script]
#!/usr/bin/perl
# Create datestamp variable
use POSIX qw(strftime);
$date = strftime('%Y%m%d', localtime());
# Create archive using TAR & GZIP
system('tar -cf ../backups/www.tar ../www/');
system('gzip -fv9 ../backups
Jas wrote:
Ok, I am getting frustrated with this... Any help is appreciated.
Step back, breathe, eat a sandwich, go for a walk... now try again...
[FTP Script]
#!/usr/bin/perl
use strict; # always
use warnings; # usually
The longer you avoid the above after having been told the shorter your
he