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/www.tar');
system('mv -fv ../backups/www.tar.gz ../backups/' . $date . '-www.tar.gz');

# Begin FTP Transaction
use Net::FTP;
$ftp = Net::FTP->new("server.test", Debug => 1)or die "Could not establish connection to server.test: $@";
$ftp->login("username", 'password')or die "Could not login ", $ftp->message;


#foreach my $list(glob('*-www.tar.gz')) {
# $ftp->ls($list)or die "Could not list files ", $ftp->message; }

foreach my $file(glob('../backups/*-www.tar.gz')) {
 $ftp->put($file) or die "Could not transfer files ", $ftp->message; }

$ftp->quit;

It says transfered in the output when you connect to server.test to see the file, the name & size descriptors are in place but when you try to extract the file it is corrupted with a CRC error. The error is this...

CRC Failed in 'name of file'. The file is corrupt

WTF, is it the transfer mode of Net::FTP? I have tried using ASCII & Binary modes to move the file and if you are on the machine that this perl script is running it extracts all the files just fine... Am I missing something here?

Any help is appreciated.
Jas


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to