1

I have the command :

./manage.py dbbackup --clean --compress

provided by the django-dbbackup app which performs a backup of my PostgreSQL database to Amazon S3. I am trying to run this command inside a django celery task run daily.

When I run:

from django.core.management import call_command
call_command('dbbackup --clean --compress', interactive=False)

I am getting an exception because of the clean and compress arguments.

Any ideas on how I can run this command?

Chris Travers
  • 25,424
  • 6
  • 65
  • 182
poiuytrez
  • 21,330
  • 35
  • 113
  • 172

1 Answers1

1

I magically found that running:

call_command('dbbackup', clean=True, compress=True, interactive=False)

works perfectly.

poiuytrez
  • 21,330
  • 35
  • 113
  • 172