Skip to content

Commit

Permalink
Fix is to consistently backup at <hostname>/data/
Browse files Browse the repository at this point in the history
1)cassandra backup location needs to be consistent even in case of the custom
  data_file_directories configured in cassandra.yaml

Change-Id: If0e90ac0ce248b06b7748a568ede3fcc13ac264e
Closes-Bug: #1566022
  • Loading branch information
aswanikumar90 committed Apr 6, 2016
1 parent afe1229 commit 50b129f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fabfile/tasks/backup_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ def backup_cassandra(db_datas, store_db='local', cassandra_backup='full'):
snapshot_dirs = sudo("find %s/ -name 'snapshots' " % db_path)
snapshot_dirs = snapshot_dirs.split('\r\n')
#get relative path to cassandra from db_path
path_to_cassandra = re.search('.*/cassandra/',db_path).group(0)
path_to_cassandra, data_dir = os.path.split(db_path)
while data_dir == '':
path_to_cassandra, data_dir = os.path.split(path_to_cassandra)
path_to_cassandra += '/'
for snapshot_dir in snapshot_dirs:
snapshot_list.append(snapshot_dir.replace(path_to_cassandra,''))
#get current snap_shot name from any snapshots folder created by nodetool
Expand Down

0 comments on commit 50b129f

Please sign in to comment.