Open
Description
Feature description
I'm configuring Django dbbackup for a client application using celery.
I've been able to create a worker that starts a task that backs up the whole app 2 times a day.
I'm using this code to start the backup:
import datetime
from celery import shared_task
from django.conf import settings
from django.core.management import call_command
@shared_task
def backup_database_each_quarter():
# if settings.DEBUG is True:
# return f"Could not be backed up: Debug is True"
try:
call_command( "dbbackup", "-c", "--noinput" )
return f"Backed up successfully: {datetime.datetime.now()}"
except Exception as err:
raise BaseException('Cannot be backed up : {}'.format(err))
During my morning check I noticed that the old 2GB db backup files are not being deleted.
If I can't delete the old files generated, the server will run out of space.
I was wondering if something like this could be added to the codebase, a management command that just deletes the previous backup files.
Otherwise, if you are adding new features, I would like to add this command that might help me or others with the same problem to solve it.
Alternatives options
No response