浏览代码

borg create help: document format tags, fixes #894

docs: rephrased, more useful examples
Thomas Waldmann 9 年之前
父节点
当前提交
9e09786b33
共有 2 个文件被更改,包括 6 次插入4 次删除
  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