Giter Club home page Giter Club logo

django-icybackup's People

Contributors

britefury avatar chriscohoat avatar daisylb avatar j4mie avatar tedtieken avatar yarlson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-icybackup's Issues

PostGIS support

Recieved via email:

Hi,

I'm eager to use icybackup but I ran into a problem and there isn't any place to report issues.

My database is Postgres but I'm using django.contrib.gis.db.backends.postgis.

Do you know if there will be any issues treating this like a normal Postgres database?

Thanks,
Shige Abe

you need to change option_list

Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/var/www/vhosts/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 364, in execute_from_command_line
utility.execute()
File "/var/www/vhosts/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/var/www/vhosts/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 206, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/var/www/vhosts/env/local/lib/python2.7/site-packages/django/core/management/init.py", line 40, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/var/www/vhosts/env/local/lib/python2.7/site-packages/icybackup/management/commands/backup.py", line 13, in
class Command(BaseCommand):
File "/var/www/vhosts/env/local/lib/python2.7/site-packages/icybackup/management/commands/backup.py", line 14, in Command
option_list = BaseCommand.option_list + (
AttributeError: type object 'BaseCommand' has no attribute 'option_list'

And django.core.management.base.BaseCommand is not containing option_list

Pruning is stuck in an infinite loop when using a glacier vault

The _do_delete function has no way of breaking out of the while loop. The backup script will hang in the loop until the user break. I'd propose a fix, but I'm not really sure what the pruning functionality is supposed to keep and what to delete.

def prune(arn, settings):
    vault = _get_vault_from_arn(arn, settings)
    keep_all_before = datetime.now() - timedelta(days=31)
    keep_daily_before = datetime.now() - timedelta(days=90)
    keep_weekly_before = datetime.now() - timedelta(days=365)
    oldest_date = models.GlacierBackup.objects.all().order_by('date')[0].date
    _do_delete(vault, 1, keep_all_before, keep_daily_before)
    _do_delete(vault, 30, keep_daily_before, keep_weekly_before)
    _do_delete(vault, 30, keep_weekly_before, oldest_date)

def _do_delete(vault, day_count, from_date, to_date):
    begin_date = from_date
    while begin_date >= to_date:
        end_date = begin_date - timedelta(days=day_count)
        if end_date < to_date:
            end_date = to_date
        qs = models.GlacierBackup.objects.filter(date__lt=end_date, date__gte=begin_date)
        # delete all but the most recent
        for record in qs[1:]:
            print "Deleting", record.glacier_id
            vault.delete(record.glacier_id)
            record.delete()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.