Try again, to move postgres dump file to /tmp before restoring

so the postgres can cd to current workdir without error..fingers
crossed this doesn't break anything else again
This commit is contained in:
Lance Edgar 2023-08-08 19:19:33 -05:00
parent bedca74ca1
commit 8e9a685006

View file

@ -259,7 +259,12 @@ def clone_db(c, name, owner, download, user='rattail', force=False, workdir=None
os.chdir(curdir) os.chdir(curdir)
# restore database on target server # restore database on target server
restore_db(c, name, '{}.sql.gz'.format(name)) # TODO: first tried c.sudo('mv ...') but that did not work for the "typical"
# scenario of connecting as rattail@server to obtain db dump, since the dump
# cmd is normally carved out via sudoers config, but 'sudo mv ..' is not
filename = f'{name}.sql.gz'
c.run(f'mv {filename} /tmp/')
restore_db(c, name, f'/tmp/{filename}')
def restore_db(c, name, path): def restore_db(c, name, path):