generalusage.rst 2.9 KB

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