generalusage.rst 2.9 KB

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