5 use Pod
::Usage
qw(pod2usage);
9 rrr-client - continously mirror recent updates
15 rrr-client --source some.mirror::module/ --target /some/dir/
23 my @opt = <<'=back' =~ /B<--(\S+)>/g;
27 Prints a brief message and exits.
29 =item B<--max-files-per-connection=i>
31 Defaults to 20000. Same as max_files_per_connection in
32 File::Rsync::Mirror::Recent
36 Password if the rsync source requires it. Can also be set by setting
37 the environment variable RSYNC_PASSWORD.
39 =item B<--rsync-timeout=i>
41 Defaults to 30. Same as C<timeout> within C<rsync_options> in
42 File::Rsync::Mirror::Recent
44 =item B<--runstatusfile=s>
46 Only needed for debugging. Path to the internally used status file.
47 Argument is passed through to the File::Rsync::Mirror::Recent object.
49 =item B<--skip-deletes!>
51 Defaults to false. If true, skips all delete events in the index files
52 which means no files are being deleted that have been deleted upstream.
56 Source to mirror from, including the name of the RECENT metadata file.
57 For example C<cpan-rsync.perl.org::CPAN/RECENT.recent>.
61 Destination directory for the mirror.
65 Directory for temporary files; should be on the same file system
66 partition as the C<--target> directory.
70 Username if the rsync source requires it.
74 Defaults to false. Note: Older versions of rrr-client defaulted to
77 =item B<--verboselog=s>
79 Path to the logfile to write verbose progress information to.
85 Mirror a remote directory based on a set of RECENT* files provided by
99 pod2usage
(1) unless $Opt{source
} and $Opt{target
};
101 $ENV{RSYNC_PASSWORD
} = $Opt{password
} if $Opt{password
};
102 $Opt{"max-files-per-connection"} ||= 20000;
103 $Opt{"rsync-timeout"} ||= 30;
104 $Opt{"skip-deletes"} ||=0;
107 use File
::Rsync
::Mirror
::Recent
;
108 my $rrr = File
::Rsync
::Mirror
::Recent
->new
110 ignore_link_stat_errors
=> 1,
111 localroot
=> $Opt{target
},
112 max_files_per_connection
=> $Opt{"max-files-per-connection"},
113 remote
=> ($Opt{user
} ?
$Opt{user
} . '@' : '') . $Opt{source
},
120 timeout
=> $Opt{"rsync-timeout"},
121 ($Opt{tmpdir
} ?
('temp-dir' => $Opt{tmpdir
}) : ()),
123 ($Opt{runstatusfile
} ?
(runstatusfile
=> $Opt{runstatusfile
}) : ()),
124 ($Opt{tmpdir
} ?
(tempdir
=> $Opt{tmpdir
}) : ()),
125 verbose
=> $Opt{verbose
},
126 ($Opt{verboselog
} ?
(verboselog
=> $Opt{verboselog
}) : ()),
127 # _logfilefordone => "recent-rmirror-donelog.log",
130 $rrr->rmirror ( "skip-deletes" => $Opt{"skip-deletes"}, loop => 1 );