瀏覽代碼

improve docs for borg with-lock (#8024)

docs: add example for borg with-lock
kmille 1 年之前
父節點
當前提交
865de9fcee
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      src/borg/archiver/lock_cmds.py

+ 5 - 1
src/borg/archiver/lock_cmds.py

@@ -73,7 +73,11 @@ class LocksMixIn:
 
 
         with_lock_epilog = process_epilog(
         with_lock_epilog = process_epilog(
             """
             """
-        This command runs a user-specified command while the repository lock is held.
+        This command runs a user-specified command while locking the repository. For example:
+
+        ::
+
+            $ BORG_REPO=/mnt/borgrepo borg with-lock rsync -av /mnt/borgrepo /somewhere/else/borgrepo
 
 
         It will first try to acquire the lock (make sure that no other operation is
         It will first try to acquire the lock (make sure that no other operation is
         running in the repo), then execute the given command as a subprocess and wait
         running in the repo), then execute the given command as a subprocess and wait