[lxc-devel] [lxd/master] rsync: handle sparse files when rsyncing

brauner on Github lxc-bot at linuxcontainers.org
Tue Jun 13 15:08:04 UTC 2017


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 381 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170613/640ef40f/attachment.bin>
-------------- next part --------------
From 09a1adb7fdf35318d49b96f922d098c78631b467 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brauner at ubuntu.com>
Date: Tue, 13 Jun 2017 17:03:55 +0200
Subject: [PATCH] rsync: handle sparse files when rsyncing

Closes #3287.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>
---
 lxd/rsync.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lxd/rsync.go b/lxd/rsync.go
index e4ccf90ff..e5f4d3d0c 100644
--- a/lxd/rsync.go
+++ b/lxd/rsync.go
@@ -34,6 +34,7 @@ func rsyncLocalCopy(source string, dest string, bwlimit string) (string, error)
 	return shared.RunCommand("rsync",
 		"-a",
 		"-HAX",
+		"--sparse",
 		"--devices",
 		"--delete",
 		"--checksum",
@@ -91,6 +92,7 @@ func rsyncSendSetup(name string, path string, bwlimit string) (*exec.Cmd, net.Co
 		"--devices",
 		"--numeric-ids",
 		"--partial",
+		"--sparse",
 		path,
 		"localhost:/tmp/foo",
 		"-e",
@@ -165,6 +167,7 @@ func RsyncRecv(path string, conn *websocket.Conn, writeWrapper func(io.WriteClos
 		"--numeric-ids",
 		"--devices",
 		"--partial",
+		"--sparse",
 		".",
 		path)
 


More information about the lxc-devel mailing list