Browse Source

Document relative path usage #1868

kmq 8 years ago
parent
commit
96ebb096e9
2 changed files with 11 additions and 4 deletions
  1. 6 3
      borg/archiver.py
  2. 5 1
      docs/usage.rst

+ 6 - 3
borg/archiver.py

@@ -1355,9 +1355,12 @@ class Archiver:
 
 
         create_epilog = textwrap.dedent("""
         create_epilog = textwrap.dedent("""
         This command creates a backup archive containing all files found while recursively
         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
         The archive will consume almost no disk space for files or parts of files that
         have already been stored in other archives.
         have already been stored in other archives.

+ 5 - 1
docs/usage.rst

@@ -435,6 +435,11 @@ Examples
     # As above, but add nanoseconds
     # As above, but add nanoseconds
     $ borg create /path/to/repo::{hostname}-{user}-{now:%Y-%m-%dT%H:%M:%S.%f} ~
     $ 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
+
 Notes
 Notes
 ~~~~~
 ~~~~~
 
 
@@ -443,7 +448,6 @@ Notes
   '\*/.bundler/gems' to get the same effect. See ``borg help patterns`` for
   '\*/.bundler/gems' to get the same effect. See ``borg help patterns`` for
   more information.
   more information.
 
 
-
 .. include:: usage/extract.rst.inc
 .. include:: usage/extract.rst.inc
 
 
 Examples
 Examples