From deb6dd7f720639d1948f08b36a4dbb5977f1a9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zlatko=20=C4=8Calu=C5=A1i=C4=87?= Date: Sat, 10 Dec 2016 12:22:06 +0100 Subject: [PATCH] Even if file changes size during backup, still save it Previously such files (typically log files) wouldn't be backed up at all! The proper behaviour is to backup what we can, and warn the operator that file is possibly not complete. But it is a warning, not an error. Closes #689 --- src/restic/archiver/archiver.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/restic/archiver/archiver.go b/src/restic/archiver/archiver.go index 8ef1814d3..78814eca4 100644 --- a/src/restic/archiver/archiver.go +++ b/src/restic/archiver/archiver.go @@ -197,7 +197,7 @@ func updateNodeContent(node *restic.Node, results []saveResult) error { } if bytes != node.Size { - return errors.Errorf("errors saving node %q: saved %d bytes, wanted %d bytes", node.Path, bytes, node.Size) + fmt.Fprintf(os.Stderr, "warning for %v: expected %d bytes, saved %d bytes\n", node.Path, node.Size, bytes) } debug.Log("SaveFile(%q): %v blobs\n", node.Path, len(results))