borg.py 918 B

1234567891011121314151617181920212223242526272829303132
  1. from functools import partial
  2. from atticmatic.config import Section_format, option
  3. from atticmatic.backends import shared
  4. # An atticmatic backend that supports Borg for actually handling backups.
  5. COMMAND = 'borg'
  6. CONFIG_FORMAT = (
  7. shared.CONFIG_FORMAT[0], # location
  8. Section_format(
  9. 'storage',
  10. (
  11. option('encryption_passphrase', required=False),
  12. option('compression', required=False),
  13. ),
  14. ),
  15. shared.CONFIG_FORMAT[2], # retention
  16. Section_format(
  17. 'consistency',
  18. (
  19. option('checks', required=False),
  20. option('check_last', required=False),
  21. ),
  22. )
  23. )
  24. initialize = partial(shared.initialize, command=COMMAND)
  25. create_archive = partial(shared.create_archive, command=COMMAND)
  26. prune_archives = partial(shared.prune_archives, command=COMMAND)
  27. check_archives = partial(shared.check_archives, command=COMMAND)