repository-urls.rst.inc 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Repository URLs
  2. ~~~~~~~~~~~~~~~
  3. **Local filesystem** (or locally mounted network filesystem):
  4. ``/path/to/repo`` - filesystem path to repo directory, absolute path
  5. ``path/to/repo`` - filesystem path to repo directory, relative path
  6. Also, stuff like ``~/path/to/repo`` or ``~other/path/to/repo`` works (this is
  7. expanded by your shell).
  8. Note: you may also prepend a ``file://`` to a filesystem path to get URL style.
  9. **Remote repositories** accessed via ssh user@host:
  10. ``ssh://user@host:port/path/to/repo`` - remote repo, absolute path
  11. **Remote repositories with relative paths** can be given using this syntax:
  12. ``ssh://user@host:port/./path/to/repo`` - path relative to current directory
  13. ``ssh://user@host:port/~/path/to/repo`` - path relative to user's home directory
  14. ``ssh://user@host:port/~other/path/to/repo`` - path relative to other's home directory
  15. If you frequently need the same repo URL, it is a good idea to set the
  16. ``BORG_REPO`` environment variable to set a default for the repo URL:
  17. ::
  18. export BORG_REPO='ssh://user@host:port/path/to/repo'
  19. Then just leave away the repo URL if only a repo URL is needed and you want
  20. to use the default - it will be read from BORG_REPO then.
  21. Use ``::`` syntax to give the repo URL when syntax requires giving a positional
  22. argument for the repo (e.g. ``borg mount :: /mnt``).
  23. Converting from scp-style repo URLs
  24. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  25. Borg does not support scp-style repo URLs any more.
  26. Here is how you can convert to URL style:
  27. ::
  28. user@host:path/to/repo # relative to cwd
  29. -->
  30. ssh://user@host:22/./path/to/repo # relative to cwd
  31. or (usually the cwd is the home dir after ssh login)
  32. ssh://user@host:22/~/path/to/repo # relative to home dir
  33. user@host:/path/to/repo # absolute repo path
  34. -->
  35. ssh://user@host:22/path/to/repo # absolute repo path
  36. Notes:
  37. Port 22 is the default, so you can omit the ``:22`` if you like.
  38. If you used some hack to use a non-standard port (which was not directly
  39. supported by the scp-style repo specification), you can now do it that way
  40. with the ``ssh:`` URL and remove the hack (usually in ssh configuration or
  41. given via ``--rsh`` borg option).