Reputation: 587
I've installed the django-dbbackup
package and from what the Documentation tells, i need to run python manage.py dbbackup
but it generated error pg_dump: error: too many command-line arguments
from what i have seen in the logs
dbbackup.db.exceptions.CommandConnectorError: Error running: pg_dump database_name --host=127.0.0.1 --port=5432 --username=postgres --no-password --clean
From what i have known, the correct command for pg_dump is to include the database name in the last part but the dbbackup include the database name first.
Anyone know the fix for the Django-dbbackup?
Upvotes: 1
Views: 1391
Reputation: 11
I had the same error. What I did was
And it worked!
Upvotes: 1
Reputation: 379
I have same issue with you, this is my env
I can manual run successfully like below, add "--dbname" parm name.
pg_dump --dbname=database_name --host=127.0.0.1 --port=5432 --username=postgres --no-password --clean
I don't know how to override the command by create a new method, so I changed the source code in dbbackup package directly, it works.
file "\Lib\site-packages\dbbackup\db\postgresql.py"
from:
cmd = '{} --dbname={}'.format(self.dump_cmd, self.settings['NAME'])
to:
cmd = '{} {}'.format(self.dump_cmd, self.settings['NAME'])
Upvotes: 0