generalusage.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. .. include:: global.rst.inc
  2. .. _generalusage:
  3. General Usage
  4. =============
  5. The following examples showcases how to use |project_name| to backup some
  6. important files from a users home directory (for more detailed information
  7. about each subcommand see the :ref:`detailed_usage` section).
  8. Initialize a local :ref:`repository <repository_def>` to store backup
  9. :ref:`archives <archive_def>` in (See :ref:`encrypted_repos` and
  10. :ref:`remote_repos` for more details)::
  11. $ attic init /somewhere/my-backup.attic
  12. Create an archive containing the ``~/src`` and ``~/Documents`` directories::
  13. $ attic create -v /somwhere/my-backup.attic::first-backup ~/src ~/Documents
  14. Create another archive the next day. This backup will be a lot quicker since
  15. only new data is stored. The ``--stats`` option tells |project_name| to print
  16. statistics about the newly created archive such as the amount of unique data
  17. (not shared with other archives)::
  18. $ attic create -v --stats /somwhere/my-backup.attic::second-backup ~/src ~/Documents
  19. List all archives in the repository::
  20. $ attic list /somewhere/my-backup.attic
  21. List the files in the *first-backup* archive::
  22. $ attic list /somewhere/my-backup.attic::first-backup
  23. Restore the *first-backup* archive::
  24. $ attic extract -v /somwhere/my-backup.attic::first-backup
  25. Recover disk space by manually deleting the *first-backup* archive::
  26. $ attic delete /somwhere/my-backup.attic::first-backup
  27. Use the ``prune`` subcommand to delete all archives except a given number of
  28. *daily*, *weekly*, *monthly* and *yearly* archives::
  29. $ attic prune /somwhere/my-backup.attic --daily=7 --weekly=2 --monthly=6
  30. .. _encrypted_repos:
  31. Repository encryption
  32. ---------------------
  33. Repository encryption is enabled at repository encryption time::
  34. $ attic init --passphrase | --key-file
  35. When repository encryption is enabled all data is encrypted using 256-bit AES_
  36. encryption and the integrity and authenticity is verified using `HMAC-SHA256`_.
  37. |project_name| supports two different methods to derive the AES and HMAC keys.
  38. Passphrase based encryption
  39. This method uses a user supplied passphrase to derive the keys using the
  40. PBKDF2_ key derivation function. This method is convenient to use and
  41. secure as long as a *strong* passphrase is used.
  42. Key file based encryption
  43. This method generates random keys at repository initialization time that
  44. are stored in a password protected file in the ``~/.attic/keys/`` directory.
  45. This method is secure and suitable for automated backups.
  46. .. Note::
  47. The repository data is totally inaccessible without the key file
  48. so it must be kept **safe**.
  49. .. _remote_repos:
  50. Remote repositories
  51. -------------------
  52. |project_name| can initialize and access repositories on remote hosts as the
  53. host is accessible using SSH and |project_name| is installed.
  54. The following syntax is used to address remote repositories::
  55. $ attic init user@hostname:repository.attic
  56. or::
  57. $ attic init ssh://user@hostname:port/repository.attic