Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Getting list of files transferred using File::RsyncP

by cengineer (Pilgrim)
on Mar 23, 2007 at 14:04 UTC ( #606241=perlquestion: print w/replies, xml ) Need Help??

cengineer has asked for the wisdom of the Perl Monks concerning the following question:


I have a storage server where data is updated on an hourly basis. I'm using File::RsyncP on a remote server to collect the new data for processing. I want to get the list of files transferred so that I can process only the new files, but I'm having trouble getting this listing. It looks like it can be done with File::RsyncP::FileList, but I'm not quite sure how to use it in my code.

Any ideas? Thank you much in advance!
use strict; use warnings; use File::RsyncP; my $rs = File::RsyncP->new({ logLevel => 1, rsyncCmd => "/bin/rsync", rsyncArgs => [ "--numeric-ids", "--perms", "--owner", "--group", "--devices", "--links", "--ignore-times", "--block-size=700", "--relative", "--recursive", "-v", ], }); my $port = 873; my $host = "storage.server"; my $module = "reports"; my $destDirectory = "/home/incoming/"; $rs->serverConnect($host, $port); $rs->serverService($module, 0, 0, 0); $rs->serverStart(1, "."); $rs->go($destDirectory); $rs->serverClose;

Replies are listed 'Best First'.
Re: Getting list of files transferred using File::RsyncP
by Anno (Deacon) on Mar 23, 2007 at 16:03 UTC
    At a glance File::RsyncP::Filelist doesn't look like the right tool. It uses an internal format derived from the standard rsync.

    If it were a standard rsync, I'd set the logging options to list transferred files and parse them from the log. If that approach is applicable to File::RsyncP, I don't know.


Re: Getting list of files transferred using File::RsyncP
by zentara (Archbishop) on Mar 23, 2007 at 15:39 UTC
Re: Getting list of files transferred using File::RsyncP
by andyford (Curate) on Mar 23, 2007 at 14:48 UTC

    Sorry if I'm missing something, but why not just look at the time stamps on the files to determine what to process?

    non-Perl: Andy Ford

      The timestamps are kept from when the file was created originally, not from when they were transferred to the storage server or to the processing server. Basically, the file creation time is not an indicator of when the file was received.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://606241]
Approved by Corion
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2023-12-07 22:35 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (33 votes). Check out past polls.