repository-urls.rst.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. ``user@host:/path/to/repo`` - remote repo, absolute path
  11. ``ssh://user@host:port/path/to/repo`` - same, alternative syntax, port can be given
  12. **Remote repositories with relative paths** can be given using this syntax:
  13. ``user@host:path/to/repo`` - path relative to current directory
  14. ``user@host:~/path/to/repo`` - path relative to user's home directory
  15. ``user@host:~other/path/to/repo`` - path relative to other's home directory
  16. Note: giving ``user@host:/./path/to/repo`` or ``user@host:/~/path/to/repo`` or
  17. ``user@host:/~other/path/to/repo`` is also supported, but not required here.
  18. **Remote repositories with relative paths, alternative syntax with port**:
  19. ``ssh://user@host:port/./path/to/repo`` - path relative to current directory
  20. ``ssh://user@host:port/~/path/to/repo`` - path relative to user's home directory
  21. ``ssh://user@host:port/~other/path/to/repo`` - path relative to other's home directory
  22. If you frequently need the same repo URL, it is a good idea to set the
  23. ``BORG_REPO`` environment variable to set a default for the repo URL:
  24. ::
  25. export BORG_REPO='ssh://user@host:port/path/to/repo'
  26. Then just leave away the repo URL if only a repo URL is needed and you want
  27. to use the default - it will be read from BORG_REPO then.
  28. Use ``::`` syntax to give the repo URL when syntax requires giving a positional
  29. argument for the repo (e.g. ``borg mount :: /mnt``).