script FTP in perl


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script FTP in perl
# 1  
Old 08-03-2010
script FTP in perl

this script should search directories read,,search for file for daily reports. you must provide the beginning day, ending day and month.
this script will pull files for days and month specified and Ftp them to another server.

Thanks for any help you provide
# 2  
Old 08-03-2010
Since the wording of this sounds like homework: what have you got this far? Have you looked at Net::FTP?
# 3  
Old 08-03-2010
Thank you,
Code:
use Sys::Syslog;
$subtowing_source = '/usr/leme/report/subtowing/    #local directori on unix
$subtowing_destination = '/mesur/reports/;             #directorie on the machine to ftp 
 
$command = '/usr/develop/bin/ftp_report.pl
 
$program = $0;
$logopt   = 'cons, pid;
$facility  = ' HSR';
openlog($program, $logoopt, $facility);
@args= ($command,$subtowing_source, $subtowing_destination);
print @args;
unless (system (@args) == 0{
 syslog('LOG_ALERT|LOG_LOCAL', 'FAILED TO SEND %S TO ETC,  $subtowing_source)
DIE():
}

This script above works for one reports at the time, i want to be able to enter begenning day , ending day , and a month on the comand line and get all the reports beteween that date i entered.

Thanks for your help

Moderator's Comments:
Mod Comment Please use code tags, and check the status of your caps lock

Last edited by pludi; 08-03-2010 at 06:37 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

FTP download using perl script

Need assistance I have a script which i can download the files from ftp server using perl . But i want to download multiple files at a time #!/usr/bin/perl -w use Net::FTP; $ftp = Net::FTP->new("ftp.ncdc.noaa.gov"); $ftp->login('username', 'password'); $ftp->cwd("<dir>");... (9 Replies)
Discussion started by: ajayram_arya
9 Replies

2. Shell Programming and Scripting

Unable to get the size of remote file using Net::FTP Perl Script

Hi, I am using below piece of code to get the size of the remote file. $ftp->cwd($destination) or $error=$ftp->message; if(!$error) { $ftp->put($file) or $error=$ftp->message; print "FTP size = \n"; ... (3 Replies)
Discussion started by: FarooqOnline
3 Replies

3. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

4. Shell Programming and Scripting

FTP Perl Script File Size Mismatch.

Hello, I've written a Perl script that copies a set of files from one server to another. Prior to transferring a file the script gets the file size from the source system and compares this to the file size received in the target system. Except that the file sizes are slightly different. ... (1 Reply)
Discussion started by: mbb
1 Replies

5. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

6. Shell Programming and Scripting

passing parameter to ftp script from output of another ftp

Hi, I have a ftp script which first gets all the file names and echo's the latest file. I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is > Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies

7. Shell Programming and Scripting

ftp from windows to unix using a perl script on unix machine

i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies

8. Shell Programming and Scripting

Help deciphering FTP get perl script

I found this very useful perl script that will check a remote ftp server, search for files of a specific time and get them. When I run the script it works, but it gave me the following error: Couldn't get filename_12-13-07.txt Bad file number What in this script would cause this? I know... (2 Replies)
Discussion started by: bbbngowc
2 Replies

9. Shell Programming and Scripting

Having a problem with a FTP Script using perl

Hello All, I have a problem that has me stumped. I am using perl to do some ftp'ing of files. I have the script in place on another environment that is functioning flawlessly. But after tweaking it to the new environment I can't get it to function. I have a search string that searches for... (6 Replies)
Discussion started by: scottzx7rr
6 Replies

10. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies
Login or Register to Ask a Question