~rgrjr/rgrjr-scripts

0ff05a1d2f98948801205a7bafaeb0e0a5db2a7c — Bob Rogers a month ago 4f4418a master
Fix some database backup dump issues

* Backup/DumpSet.pm:
   + (_parse_file_name):  The "(\d{8,6}-\d{4})" regexp for database
     dumps isn't actually working the way it ought to, so use
     "(\d{8}-\d{4})" since that's what we've actually got.
* vacuum.pl:
   + (find_files_to_copy):  Use "gt" instead of ">" for date comparison,
     because these strings are no longer guaranteed to be numeric, but
     the date strings from comparable backups are always the same
     length, so string comparison will give the same result.
2 files changed, 2 insertions(+), 2 deletions(-)

M Backup/DumpSet.pm
M vacuum.pl
M Backup/DumpSet.pm => Backup/DumpSet.pm +1 -1
@@ 94,7 94,7 @@ sub _parse_file_name {
	my $index = $alpha_index ? ord($alpha_index)-ord('a')+1 : 0;
	return ($pfx, $date, $level, $index, 0, $file_name, $size);
    }
    elsif ($file_name =~ m@([^/]+)-(\d{6,8}-\d{4})\.dump(\.gz)?$@) {
    elsif ($file_name =~ m@([^/]+)-(\d{8}-\d{4})\.dump(\.gz)?$@) {
	# database backup.
	my ($pfx, $date_time) = $file_name =~ //;
	return ($pfx, $date_time, 0, 1, 0, $file_name, $size);

M vacuum.pl => vacuum.pl +1 -1
@@ 161,7 161,7 @@ sub find_files_to_copy {
	elsif (defined($to{$name})) {
	    # already there.
	}
	elsif ($latest_full && $latest_full->date > $from->date) {
	elsif ($latest_full && $latest_full->date gt $from->date) {
	    # Superseded full dump.  This can happen when we are copying from a
	    # partition with an older full dump, when the current full dump is
	    # not present.  This is, of course, a kludge.  -- rgr, 5-Jun-10.