Browse Source

Update prune documentation to use new command line options,
and also to say that the time that matters is the time each
backup completes.

Dan Christensen 11 năm trước cách đây
mục cha
commit
4c4018e1d7
2 tập tin đã thay đổi với 15 bổ sung10 xóa
  1. 4 3
      attic/archiver.py
  2. 11 7
      docs/usage.rst

+ 4 - 3
attic/archiver.py

@@ -548,11 +548,12 @@ Type "Yes I am sure" if you understand this and want to continue.\n""")
         backups. As an example, "-d 7" means to keep the latest backup on each day
         for 7 days. Days without backups do not count towards the total. The rules
         are applied from hourly to yearly, and backups selected by previous rules do
-        not count towards those of later rules. Dates and times are interpreted in
+        not count towards those of later rules. The time that each backup completes
+        is used for pruning purposes. Dates and times are interpreted in
         the local timezone, and weeks go from Monday to Sunday. Specifying a
         negative number of archives to keep means that there is no limit.
-        The "--within" option takes an argument of the form "<int><char>",
-        where char is "H", "d", "w", "m", "y". For example, "--within 2d" means
+        The "--keep-within" option takes an argument of the form "<int><char>",
+        where char is "H", "d", "w", "m", "y". For example, "--keep-within 2d" means
         to keep all archives that were created within the past 48 hours.
         "1m" is taken to mean "31d". The archives kept with this option do not
         count towards the totals specified by any other options. If a

+ 11 - 7
docs/usage.rst

@@ -131,15 +131,19 @@ Examples
 ~~~~~~~~
 ::
 
-    # Keep 7 end of day and 4 additional end of week archives
-    $ attic prune /data/myrepo --daily=7 --weekly=4
+    # Keep 7 end of day and 4 additional end of week archives:
+    $ attic prune /data/myrepo --keep-daily=7 --keep-weekly=4
 
-    # Same as above but only apply to archive names starting with "foo"
-    $ attic prune /data/myrepo --daily=7 --weekly=4 --prefix=foo
+    # Same as above but only apply to archive names starting with "foo":
+    $ attic prune /data/myrepo --keep-daily=7 --keep-weekly=4 --prefix=foo
 
-    # Keep 7 end of day, 4 additional end of week archives, and an
-    # end of month archive for every month:
-    $ attic prune /data/myrepo --daily=7 --weekly=4 --monthly=-1
+    # Keep 7 end of day, 4 additional end of week archives,
+    # and an end of month archive for every month:
+    $ attic prune /data/myrepo --keep-daily=7 --keep-weekly=4 --monthly=-1
+
+    # Keep all backups in the last 10 days, 4 additional end of week archives,
+    # and an end of month archive for every month:
+    $ attic prune /data/myrepo --keep-within=10d --keep-weekly=4 --monthly=-1
 
 
 .. include:: usage/info.rst.inc