Move sql file to temp path when restoring postgres db
otherwise postgres may throw an error, if it can't cd to current workdir
This commit is contained in:
parent
6479af6a57
commit
94945fbc30
|
@ -259,7 +259,9 @@ 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))
|
filename = f'{name}.sql.gz'
|
||||||
|
c.sudo(f'mv {filename} /tmp/')
|
||||||
|
restore_db(c, name, f'/tmp/{filename}')
|
||||||
|
|
||||||
|
|
||||||
def restore_db(c, name, path):
|
def restore_db(c, name, path):
|
||||||
|
|
Loading…
Reference in a new issue