Anyone have a script coded in perl or sh to backup and tarball important files (you specify dirs) and upload to a remote ftp site? I have coded about 2 and I cant seem to get this remote ftp string working and started all over again......
you can use FTP easily from a perl script, if that is
what you are tring to do:
$username = "foo";
$password = "bar";
my $localfile = "data.txt";
my $remotefile = "data.txt";
my $ftp = Net::FTP->new("whatever.domain.com",
Passive => 1,
Timeout => 60,
Debug => 1)
or die "Can't connect: $@\n";
$ftp->login($username, $password) or die "Couldn't login\n";
$ftp->put($localfile, $remotefile) or die "Couldn't put $localfile\n";
Note that the above doesn't change directories on the
remote server (whatever.domain.com).
and make sure you chdir to the local directory where
the example file 'data.txt' resides.