Skip to content

Commit

Permalink
Use name of db inside archive, not the archive filename.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Russell committed Jun 23, 2020
1 parent 3236c01 commit 6c3a971
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/azanium/runcommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,15 +220,15 @@ def backup_db(context, db_name=None):
local_backup_path = os.path.join(context.path('datomic-db-backup'),
date_stamp,
db_name)
arcname = '{}.tar.xz'.format(db_name)
archive_filename = '{}.tar.xz'.format(db_name)
archive_path = os.path.join(os.path.dirname(local_backup_path),
arcname)
archive_filename)
if not os.path.isdir(local_backup_path):
datomic.backup_db(context, local_backup_path, db_name)
if not os.path.isfile(archive_path):
logger.info('Creating archive {} for upload', archive_path)
with tarfile.open(archive_path, mode='w:xz') as tf:
tf.add(local_backup_path, arcname=arcname)
tf.add(local_backup_path, arcname=db_name)
result = 'Datomic database compressed to {bp}.'.format(bp=archive_path)
click.echo(result)
return result
Expand Down

0 comments on commit 6c3a971

Please sign in to comment.