From 757921dbdc67759b5a68d2580328cb52ce29c2be Mon Sep 17 00:00:00 2001 From: kmq Date: Sun, 26 Feb 2017 20:33:15 +0200 Subject: [PATCH] Document relative path usage #1868 --- docs/usage.rst | 5 +++++ src/borg/archiver.py | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index d11aff604..dfd77b56e 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -108,6 +108,11 @@ Examples # As above, but add nanoseconds $ borg create /path/to/repo::{hostname}-{user}-{now:%Y-%m-%dT%H:%M:%S.%f} ~ + # Backing up relative paths by moving into the correct directory first + $ cd /home/user/Documents + # The root directory of the archive will be "projectA" + $ borg create /path/to/repo::daily-projectA-{now:%Y-%m-%d} projectA + .. include:: usage/extract.rst.inc diff --git a/src/borg/archiver.py b/src/borg/archiver.py index f81c583cb..238ba5986 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2133,9 +2133,12 @@ class Archiver: create_epilog = process_epilog(""" This command creates a backup archive containing all files found while recursively - traversing all paths specified. When giving '-' as path, borg will read data - from standard input and create a file 'stdin' in the created archive from that - data. + traversing all paths specified. Paths are added to the archive as they are given, + that means if relative paths are desired, the command has to be run from the correct + directory. + + When giving '-' as path, borg will read data from standard input and create a + file 'stdin' in the created archive from that data. The archive will consume almost no disk space for files or parts of files that have already been stored in other archives.