Skip to content

Commit 813f579

Browse files
author
Dilshat
authored
Merge pull request #602 from subutai-io/dev
#599 Dev->Master
2 parents 2978584 + f5fd5fd commit 813f579

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

cli/export.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ func LxcExport(name, newname, version, prefsize, token, description string, priv
8888
os.MkdirAll(dst+"/deltas", 0755)
8989

9090
for _, vol := range []string{"rootfs", "home", "opt", "var"} {
91-
// snapshot each partition
92-
if !fs.DatasetExists(name + "/" + vol + "@now") {
93-
fs.CreateSnapshot(name + "/" + vol + "@now")
91+
//remove old snapshot if any
92+
if fs.DatasetExists(name + "/" + vol + "@now") {
93+
fs.RemoveDataset(name+"/"+vol+"@now", false)
9494
}
95+
// snapshot each partition
96+
fs.CreateSnapshot(name + "/" + vol + "@now")
97+
9598
// send incremental delta between parent and child to delta file
9699
fs.SendStream(parentRef+"/"+vol+"@now", name+"/"+vol+"@now", dst+"/deltas/"+vol+".delta")
97100
}

0 commit comments

Comments
 (0)