+#
+# Update the backupInfo files based on the backups file.
+# We do this just once a week (on Sun) since it is only
+# needed for old backups with BackupPC <= 2.1.2.
+#
+sub doBackupInfoUpdate
+{
+ my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
+ return if ( $wday != 0 );
+
+ foreach my $host ( sort(keys(%{$bpc->HostInfoRead()})) ) {
+ my @Backups = $bpc->BackupInfoRead($host);
+
+ for ( my $i = 0 ; $i < @Backups ; $i++ ) {
+ #
+ # BackupPC::Storage->backupInfoWrite won't overwrite
+ # an existing file
+ #
+ BackupPC::Storage->backupInfoWrite("$TopDir/pc/$host",
+ $Backups[$i]{num},
+ $Backups[$i]);
+ }
+ }
+}
+