2
0

quickstart_example.rst.inc 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. 1. Before a backup can be made a repository has to be initialized::
  2. $ borg init --encryption=repokey /path/to/repo
  3. 2. Backup the ``~/src`` and ``~/Documents`` directories into an archive called
  4. *Monday*::
  5. $ borg create /path/to/repo::Monday ~/src ~/Documents
  6. 3. The next day create a new archive called *Tuesday*::
  7. $ borg create --stats /path/to/repo::Tuesday ~/src ~/Documents
  8. This backup will be a lot quicker and a lot smaller since only new never
  9. before seen data is stored. The ``--stats`` option causes Borg to
  10. output statistics about the newly created archive such as the amount of unique
  11. data (not shared with other archives)::
  12. ------------------------------------------------------------------------------
  13. Archive name: Tuesday
  14. Archive fingerprint: bd31004d58f51ea06ff735d2e5ac49376901b21d58035f8fb05dbf866566e3c2
  15. Time (start): Tue, 2016-02-16 18:15:11
  16. Time (end): Tue, 2016-02-16 18:15:11
  17. Duration: 0.19 seconds
  18. Number of files: 127
  19. ------------------------------------------------------------------------------
  20. Original size Compressed size Deduplicated size
  21. This archive: 4.16 MB 4.17 MB 26.78 kB
  22. All archives: 8.33 MB 8.34 MB 4.19 MB
  23. Unique chunks Total chunks
  24. Chunk index: 132 261
  25. ------------------------------------------------------------------------------
  26. 4. List all archives in the repository::
  27. $ borg list /path/to/repo
  28. Monday Mon, 2016-02-15 19:14:44
  29. Tuesday Tue, 2016-02-16 19:15:11
  30. 5. List the contents of the *Monday* archive::
  31. $ borg list /path/to/repo::Monday
  32. drwxr-xr-x user group 0 Mon, 2016-02-15 18:22:30 home/user/Documents
  33. -rw-r--r-- user group 7961 Mon, 2016-02-15 18:22:30 home/user/Documents/Important.doc
  34. ...
  35. 6. Restore the *Monday* archive by extracting the files relative to the current directory::
  36. $ borg extract /path/to/repo::Monday
  37. 7. Recover disk space by manually deleting the *Monday* archive::
  38. $ borg delete /path/to/repo::Monday
  39. .. Note::
  40. Borg is quiet by default (it works on WARNING log level).
  41. You can use options like ``--progress`` or ``--list`` to get specific
  42. reports during command execution. You can also add the ``-v`` (or
  43. ``--verbose`` or ``--info``) option to adjust the log level to INFO to
  44. get other informational messages.