debug.rst 1.7 KB

12345678910111213141516171819202122232425262728293031323334
  1. Debugging Facilities
  2. --------------------
  3. There is a ``borg debug`` command that has some subcommands which are all
  4. **not intended for normal use** and **potentially very dangerous** if used incorrectly.
  5. For example, ``borg debug put-obj`` and ``borg debug delete-obj`` will only do
  6. what their name suggests: put objects into repo / delete objects from repo.
  7. Please note:
  8. - they will not update the chunks cache (chunks index) about the object
  9. - they will not update the manifest (so no automatic chunks index resync is triggered)
  10. - they will not check whether the object is in use (e.g. before delete-obj)
  11. - they will not update any metadata which may point to the object
  12. They exist to improve debugging capabilities without direct system access, e.g.
  13. in case you ever run into some severe malfunction. Use them only if you know
  14. what you are doing or if a trusted Borg developer tells you what to do.
  15. Borg has a ``--debug-topic TOPIC`` option to enable specific debugging messages. Topics
  16. are generally not documented.
  17. A ``--debug-profile FILE`` option exists which writes a profile of the main program's
  18. execution to a file. The format of these files is not directly compatible with the
  19. Python profiling tools, since these use the "marshal" format, which is not intended
  20. to be secure (quoting the Python docs: "Never unmarshal data received from an untrusted
  21. or unauthenticated source.").
  22. The ``borg debug profile-convert`` command can be used to take a Borg profile and convert
  23. it to a profile file that is compatible with the Python tools.
  24. Additionally, if the filename specified for ``--debug-profile`` ends with ".pyprof" a
  25. Python compatible profile is generated. This is only intended for local use by developers.