Browse Source

Only repair backups if repairing

pull/10/head
Dennis Schwerdel 5 years ago
parent
commit
1617fecb92
  1. 2
      CHANGELOG.md
  2. 12
      src/repository/integrity.rs

2
CHANGELOG.md

@ -8,8 +8,10 @@ This project follows [semantic versioning](http://semver.org).
* [added] Added date to bundles
* [modified] Logging to stderr
* [modified] Enforce deterministic bundle ordering
* [modified] More info in analyze subcommand
* [fixed] Only print "repairing bundles" if actually repairing bundles
* [fixed] Only put mode bits of st_mode into metadata
* [fixed] Only repairing backups with --repair
### v0.2.0 (2017-04-14)

12
src/repository/integrity.rs

@ -135,11 +135,13 @@ impl Repository {
*chunks = c;
modified = true;
},
Err(err) => {
Err(err) => if repair {
warn!("Problem detected: inode {:?} is corrupt\n\tcaused by: {}", path.join(name), err);
info!("Removing broken inode from backup");
removed.push(name.to_string());
modified = true;
} else {
return Err(err)
}
}
}
@ -185,9 +187,11 @@ impl Repository {
try!(self.evacuate_broken_backup(&name));
try!(self.save_backup(&backup, &name));
},
Err(err) => {
Err(err) => if repair {
warn!("The root of the backup {} has been corrupted\n\tcaused by: {}", name, err);
try!(self.evacuate_broken_backup(&name));
} else {
return Err(err)
}
}
Ok(())
@ -285,9 +289,11 @@ impl Repository {
try!(self.evacuate_broken_backup(&name));
try!(self.save_backup(&backup, &name));
},
Err(err) => {
Err(err) => if repair {
warn!("The root of the backup {} has been corrupted\n\tcaused by: {}", name, err);
try!(self.evacuate_broken_backup(&name));
} else {
return Err(err)
}
}
}

Loading…
Cancel
Save