chiark / gitweb /
expire-iso8601: tidy docs and exit status
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 20 Aug 2020 10:23:07 +0000 (11:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 20 Aug 2020 10:23:07 +0000 (11:23 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
scripts/expire-iso8601

index 548baae60c2a18ac3a122d9fe12e9250e6bccb30..8ec0aef11544a1c8c8c86ac52414a085eb07c1c1 100755 (executable)
@@ -24,10 +24,11 @@ usage:
 options:
    -u<unitlen>  <interval> is measured in units of <unitlen> seconds
                    (default is 86400, so <interval> is in days)
-   -s<slop>     allow kept items to be <slop> seconds shorter apart than
-                   specified; default is 10% of <unitlen>
-   -n           do not really delete
-   -r           recursive removal (rm -r)
+   -s<slop>       allow kept items to be <slop> seconds shorter or
+                   longer apart than specified; default is 0.1 unit
+   -n             do not really delete
+   -r             recursive removal (rm -r)
+   --help
 example:
    /home/ian/junk/expire-iso8601 14x1 4x7
       uses units of 86400s (1 day) with a slop of 8640
@@ -41,7 +42,7 @@ exit status:
    0                   ok
    4                   rm failed
    8                   bad usage
-   16                  catastrophic failure
+  -1                   catastrophic failure
 END
 
 use POSIX;
@@ -196,7 +197,7 @@ sub do_rm ($) {
   if ($rm) {
     my $r= system 'rm', ($recurse ? ('-r') : ()), "--", $fn;
     die "run rm: $!\n" unless defined($r) && $r >= 0;
-    exit 12 if $r;
+    exit 4 if $r;
   }
 }