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 exists.
31 Source to mirror from, including the name of the RECENT metadata file.
32 For example C<cpan-rsync.perl.org::CPAN/RECENT.recent>.
36 Destination directory for the mirror.
40 Username if the rsync source requires it.
44 Password if the rsync source requires it. Can also be set by setting
45 the environment variable RSYNC_PASSWORD.
49 Directory for temporary files; should be on the same file system
50 partition as the C<--target> directory.
56 After you have setup a tree watch it with inotify and keep it
57 uptodate. Depends on inotify which probably only exists on linux.
70 pod2usage
(1) unless $Opt{source
} and $Opt{target
};
72 $ENV{RSYNC_PASSWORD
} = $Opt{password
} if $Opt{password
};
74 use File
::Rsync
::Mirror
::Recent
;
75 my $rrr = File
::Rsync
::Mirror
::Recent
->new
77 ignore_link_stat_errors
=> 1,
78 localroot
=> $Opt{target
},
79 ($Opt{tmpdir
} ?
(tempdir
=> $Opt{tmpdir
}) : ()),
80 remote
=> ($Opt{user
} ?
$Opt{user
} . '@' : '') . $Opt{source
},
81 max_files_per_connection
=> 20000,
88 timeout
=> 30, # do not allow rsync to hang for too long
89 ($Opt{tmpdir
} ?
('temp-dir' => $Opt{tmpdir
}) : ()),
92 _runstatusfile
=> "recent-rmirror-state.yml",
93 # _logfilefordone => "recent-rmirror-donelog.log",
96 $rrr->rmirror ( "skip-deletes" => 0, loop => 1 );