the whole year 1994; with timings
[rersyncrecent.git] / bin / rrr-dirtyupdate
blob5543e413591f729466b8f17eb051e3b017de1875
1 #!/usr/bin/perl -- -*- mode: cperl -*-
3 =head1 NAME
5 rrr-dirtyupdate - add a file with an old timestamp to the dataset
7 =head1 SYNOPSIS
9 rrr-dirtyupdate [options] file epoch
11 =head1 OPTIONS
13 =over 8
15 =cut
17 my @opt = <<'=back' =~ /B<--(\S+)>/g;
19 =item B<--dry-run!>
21 (TBD) Do not really run the command, ...
23 =item B<--help|h>
25 Prints a brief message and exists.
27 =item B<--verbose|v+>
29 More feedback.
31 =back
33 =head1 DESCRIPTION
35 When you later discover missing files...
37 =head1 BUGS
39 This is slow.
41 =cut
44 use strict;
45 use warnings;
47 use File::Rsync::Mirror::Recent;
48 use Getopt::Long;
49 use Pod::Usage qw(pod2usage);
51 our %Opt;
52 GetOptions(\%Opt,
53 @opt,
54 ) or pod2usage(1);
56 if ($Opt{help}) {
57 pod2usage(0);
60 unless (@ARGV) {
61 pod2usage(1);
64 # my($file,$epoch) = @ARGV; # XXX
66 if ($Opt{'dry-run'}) {
67 die "FIXME: not yet implemented";
70 my $rf = File::Rsync::Mirror::Recentfile->new_from_file
72 "/home/ftp/pub/PAUSE/authors/RECENT-1h.yaml",
74 unless ($rf) {
75 die "ALERT: Could not create an rf: $@";
77 my $sleep = 2;
78 warn "prove of concept for one file only. Last chance to hit ^C now to interrupt. sleeping $sleep";
79 sleep $sleep;
81 my @files = qw(
82 /home/ftp/pub/PAUSE/authors/id/M/MI/MICB/Des-perl-a1.readme
83 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/splain.gz
84 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/ADVLABS/net/qotd.gz
85 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/clip.gz
86 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/dfgripe.gz
87 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/dupwords.gz
88 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/dutree.gz
89 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/flinx.gz
90 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/hwo.gz
91 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/igrep.gz
92 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/manpath.gz
93 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/pgrep.gz
94 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/pt.gz
95 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/rename.gz
96 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/rmmq.gz
97 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/rweb.gz
98 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/seced.gz
99 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/sigrand.gz
100 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/sox.gz
101 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/ssl.gz
102 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/straycats.gz
103 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/suidscript.gz
104 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/tfiles.gz
105 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/tgent.gz
106 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/zap.gz
107 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/man.shar.gz
108 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/sortsig.gz
109 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/ADVLABS/net/TCP/sigrand.gz
110 /home/ftp/pub/PAUSE/authors/id/E/EH/EHOOD/makehomeidx1.1.1.readme
111 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/clip.gz
112 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/cptimes.gz
113 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/dfgripe.gz
114 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/dupwords.gz
115 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/dutree.gz
116 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/expn.gz
117 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/flinx.gz
118 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/hwo.gz
119 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/igrep.gz
120 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/lst.gz
121 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/manpath.gz
122 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/now.gz
123 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/pgrep.gz
124 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/pt.gz
125 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/rename.gz
126 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/rmmq.gz
127 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/rweb.gz
128 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/seced.gz
129 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/sigrand.gz
130 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/sortbylen.gz
131 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/sox.gz
132 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/ssl.gz
133 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/straycats.gz
134 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/suidscript.gz
135 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/tcgrep.gz
136 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/tct.gz
137 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/tfiles.gz
138 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/tgent.gz
139 /home/ftp/pub/PAUSE/authors/id/T/TO/TOMC/scripts/doc/zap.gz
140 /home/ftp/pub/PAUSE/authors/id/E/EH/EHOOD/perlMIF.beta2.readme
141 /home/ftp/pub/PAUSE/authors/id/M/MU/MUIR/perl4/parseargs.pl.gz
144 warn "starting at ".localtime;
145 for my $file (@files) {
146 my @stat = stat $file or die "Couldn't stat '$file': $!";
147 my $mtime = $stat[9];
148 $rf->update($file,"new",$mtime);
150 warn "starting first aggregate at ".localtime;
151 $rf->aggregate(force => 1);
152 warn "starting second aggregate at ".localtime;
153 $rf->aggregate(force => 1);
154 warn "finished at ".localtime;
156 __END__
159 # Local Variables:
160 # mode: cperl
161 # coding: utf-8
162 # cperl-indent-level: 4
163 # End: