Răsfoiți Sursa

Merge pull request #1010 from ThomasWaldmann/doc-tags

borg create help: document format tags, fixes #894
TW 9 ani în urmă
părinte
comite
6ae1999ff3
2 a modificat fișierele cu 6 adăugiri și 4 ștergeri
  1. 3 0
      borg/archiver.py
  2. 3 4
      docs/usage.rst

+ 3 - 0
borg/archiver.py

@@ -997,6 +997,9 @@ class Archiver:
         '.checkpoint.N' (with N being a number), because these names are used for
         '.checkpoint.N' (with N being a number), because these names are used for
         checkpoints and treated in special ways.
         checkpoints and treated in special ways.
 
 
+        In the archive name, you may use the following format tags:
+        {now}, {utcnow}, {fqdn}, {hostname}, {user}, {pid}
+
         To speed up pulling backups over sshfs and similar network file systems which do
         To speed up pulling backups over sshfs and similar network file systems which do
         not provide correct inode information the --ignore-inode flag can be used. This
         not provide correct inode information the --ignore-inode flag can be used. This
         potentially decreases reliability of change detection, while avoiding always reading
         potentially decreases reliability of change detection, while avoiding always reading

+ 3 - 4
docs/usage.rst

@@ -301,10 +301,9 @@ Examples
     # Even slower, even higher compression (N = 0..9)
     # Even slower, even higher compression (N = 0..9)
     $ borg create --compression lzma,N /path/to/repo::arch ~
     $ borg create --compression lzma,N /path/to/repo::arch ~
 
 
-    # Format tags available for archive name:
-    # {now}, {utcnow}, {fqdn}, {hostname}, {user}, {pid}
-    # add short hostname, backup username and current unixtime (seconds from epoch)
-    $ borg create  /path/to/repo::{hostname}-{user}-{now:%s} ~
+    # Use short hostname, user name and current time in archive name
+    $ borg create /path/to/repo::{hostname}-{user}-{now} ~
+    $ borg create /path/to/repo::{hostname}-{user}-{now:%Y-%m-%d_%H:%M:%S} ~
 
 
 .. include:: usage/extract.rst.inc
 .. include:: usage/extract.rst.inc