Automatically fix any scrub date that is in the future

This commit is contained in:
Andrea Mazzoleni 2018-09-25 22:17:21 +02:00
parent 294a0ae90d
commit f8d86abf4f
3 changed files with 25 additions and 4 deletions

View file

@ -29,6 +29,10 @@
unsigned day_ago(time_t ref, time_t now)
{
/* in case some dates is in the future */
if (now < ref)
return 0;
return (now - ref) / (24 * 3600);
}
@ -458,6 +462,10 @@ int state_status(struct snapraid_state* state)
printf("\n");
if (newest > now) {
printf("WARNING! You have scrub dates in the future! The next sync/scrub will truncate them!\n");
}
if (unsynced_blocks) {
printf("WARNING! The array is NOT fully synced.\n");
printf("You have a sync in progress at %u%%.\n", (blockmax - unsynced_blocks) * 100 / blockmax);