Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Getting list of files transferred using File::RsyncP

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

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

Hello,

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.

    Anno

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-23 18:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found