This nice little Perl script that I wrote that will take a set of files from a folder and FTP them to a specified host.
It is pretty simple. There are tons of scripts out there that will the same. I hope you find it useful.
Enjoy!
<code>
#!/usr/local/bin/perl
###FTP PROCESS##
#Variables
########################################
###Username
$USERNAME = “”;
###Host name or address
$HOST = “”;
###Password
$PASSWORD = “”;
#Directory where the files you want to move reside
$LOCALDIR = “”;
#####Extension of the files you want to move – You can use wild characters.
$ext =”";
#######Do not edit below this line ###########################
my $dir = “$LOCALDIR”;
my @files = <$dir/$ext>;
foreach my $transferfiles (@files)
{
####print “files to be transfered \n”; For testing purposes only
####print “$transferfiles \n”; For testing purposes only
use Net::FTP;
$ftp = Net::FTP->new(“$HOST”, Debug=>0);
die “Cannot Connect to $HOST $!” unless $ftp;
$ftp->login(“$USERNAME”,”$PASSWORD”, Debug=>0);
$ftp->cwd(“$LOCALDIR”);
$ftp->put(“$transferfiles”);
$ftp->quit;
}
<code>




What’s going on man? Long time no talk. I checked your site a few times, and it looked like some squatter took your domain. Good to see you back. Yea, I had a kid two months ago. She is driving us both crazy, but it’s a lot of fun.
So are you doing programming now?
I know, it’s been a while. Congratulations on your baby girl!
Yeah, someone try to take my domain thinking they could be like me, but i finally got him back.
I’m just trying to learn new stuff.
I really liked this post. Can I copy it to my site? Thank you in advance.