UNTESTED SAMPLE CODE
#!/usr/bin/perl
net use Net::FTP
$DIRName = "/ftp/dir";
chdir $DIRName;
@Files = glob *;
$ftp = Net::FTP->new("HOST.DOMAIN.COM", Debug=>0);
$ftp->login("user", "password");
$ftp->cwd("/remote/dir");
foreach (@Files) {
$ftp->put($_);
}
$ftp->quit;
foreach (@Files) {
unlink $_;
}
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Craig Sharp
Sent: Monday, June 09, 2003 10:34 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] URGENT: Scan a directory and ftp if there are
files
Hi all,
I need a example of scanning a directory on a scheduled basis (crontab)
for files. If there are files in the directory, those files need to be
ftp'ed to a server and then deleted from the sending server. This is an
automated incoming mailbox for EDI and the data needs to be transfered
when it arrives.
This is a hot task so any help would be appreciated.
Thanks!
Craig A. Sharp
Unix Systems Administrator
DNS Administrator
Security Administrator
Roush Industries
Office: 734-466-6286
Cell: 734-231-6769
Fax: 734-466-6939
[EMAIL PROTECTED]
====================================================
I have not lost my mind, it's backed up on tape somewhere!
====================================================
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs