From 7de7a33653eebe589ce16ef0cc702298355faa36 Mon Sep 17 00:00:00 2001 From: Rajesh Rajendran Date: Sun, 26 Jul 2020 23:28:35 +0530 Subject: [PATCH] Remove files after adding them to tar Else it'll take 2x size of the backup till the backup completes Signed-off-by: Rajesh Rajendran --- deploy/cassandra_backup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/cassandra_backup.py b/deploy/cassandra_backup.py index 26796b920f..5f1e6e85e5 100755 --- a/deploy/cassandra_backup.py +++ b/deploy/cassandra_backup.py @@ -100,7 +100,7 @@ def copy(): print("Snapshot taken.") copy() print("Making a tarball: {}.tar.gz".format(args.snapshotname)) - command = "cd {} && tar -czvf {}/{}.tar.gz *".format(tmpdir, args.tardirectory, args.snapshotname) + command = "cd {} && tar --remove-files -czvf {}/{}.tar.gz *".format(tmpdir, args.tardirectory, args.snapshotname) rc = system(command) if rc != 0: print("Creation of tar failed")