Skip to content

Commit

Permalink
Check tar creation succeeded or not
Browse files Browse the repository at this point in the history
Signed-off-by: Rajesh Rajendran <[email protected]>
  • Loading branch information
rjshrjndrn committed Jul 25, 2020
1 parent 4eac924 commit 552f77e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deploy/cassandra_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ def copy():
copy()
print("Making a tarball: {}.tar.gz".format(args.snapshotname))
command = "cd {} && tar -czvf {}/{}.tar.gz *".format(tmpdir, args.tardirectory, args.snapshotname)
system(command)
rc = system(command)
if rc != 0:
print("Creation of tar failed")
exit(1)
# Cleaning up backup directory
rmtree(tmpdir)
print("Cassandra backup completed and stored in {}/{}.tar.gz".format(args.tardirectory, args.snapshotname))
Expand Down

0 comments on commit 552f77e

Please sign in to comment.