mirror of https://github.com/dswd/zvault
Only repair backups if repairing
This commit is contained in:
parent
66e56b9b0c
commit
1617fecb92
|
@ -8,8 +8,10 @@ This project follows [semantic versioning](http://semver.org).
|
||||||
* [added] Added date to bundles
|
* [added] Added date to bundles
|
||||||
* [modified] Logging to stderr
|
* [modified] Logging to stderr
|
||||||
* [modified] Enforce deterministic bundle ordering
|
* [modified] Enforce deterministic bundle ordering
|
||||||
|
* [modified] More info in analyze subcommand
|
||||||
* [fixed] Only print "repairing bundles" if actually repairing bundles
|
* [fixed] Only print "repairing bundles" if actually repairing bundles
|
||||||
* [fixed] Only put mode bits of st_mode into metadata
|
* [fixed] Only put mode bits of st_mode into metadata
|
||||||
|
* [fixed] Only repairing backups with --repair
|
||||||
|
|
||||||
|
|
||||||
### v0.2.0 (2017-04-14)
|
### v0.2.0 (2017-04-14)
|
||||||
|
|
|
@ -135,11 +135,13 @@ impl Repository {
|
||||||
*chunks = c;
|
*chunks = c;
|
||||||
modified = true;
|
modified = true;
|
||||||
},
|
},
|
||||||
Err(err) => {
|
Err(err) => if repair {
|
||||||
warn!("Problem detected: inode {:?} is corrupt\n\tcaused by: {}", path.join(name), err);
|
warn!("Problem detected: inode {:?} is corrupt\n\tcaused by: {}", path.join(name), err);
|
||||||
info!("Removing broken inode from backup");
|
info!("Removing broken inode from backup");
|
||||||
removed.push(name.to_string());
|
removed.push(name.to_string());
|
||||||
modified = true;
|
modified = true;
|
||||||
|
} else {
|
||||||
|
return Err(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,9 +187,11 @@ impl Repository {
|
||||||
try!(self.evacuate_broken_backup(&name));
|
try!(self.evacuate_broken_backup(&name));
|
||||||
try!(self.save_backup(&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);
|
warn!("The root of the backup {} has been corrupted\n\tcaused by: {}", name, err);
|
||||||
try!(self.evacuate_broken_backup(&name));
|
try!(self.evacuate_broken_backup(&name));
|
||||||
|
} else {
|
||||||
|
return Err(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -285,9 +289,11 @@ impl Repository {
|
||||||
try!(self.evacuate_broken_backup(&name));
|
try!(self.evacuate_broken_backup(&name));
|
||||||
try!(self.save_backup(&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);
|
warn!("The root of the backup {} has been corrupted\n\tcaused by: {}", name, err);
|
||||||
try!(self.evacuate_broken_backup(&name));
|
try!(self.evacuate_broken_backup(&name));
|
||||||
|
} else {
|
||||||
|
return Err(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue