Skip to content

Commit

Permalink
Remove files after adding them to tar
Browse files Browse the repository at this point in the history
Else it'll take 2x size of the backup till the backup completes

Signed-off-by: Rajesh Rajendran <[email protected]>
  • Loading branch information
rjshrjndrn committed Jul 26, 2020
1 parent 552f77e commit 7de7a33
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deploy/cassandra_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 7de7a33

Please sign in to comment.