github.com/rkt/rkt@v1.30.1-0.20200224141603-171c416fac02/Documentation/subcommands/gc.md (about)

     1  # rkt gc
     2  
     3  rkt has a built-in garbage collection command that is designed to be run periodically from a timer or cron job.
     4  Stopped pods are moved to the garbage and cleaned up during a subsequent garbage collection pass.
     5  Each `gc` pass removes any pods remaining in the garbage past the grace period.
     6  [Read more about the pod lifecycle][gc-docs].
     7  
     8  ```
     9  # rkt gc --grace-period=30m0s
    10  Moving pod "21b1cb32-c156-4d26-82ae-eda1ab60f595" to garbage
    11  Moving pod "5dd42e9c-7413-49a9-9113-c2a8327d08ab" to garbage
    12  Moving pod "f07a4070-79a9-4db0-ae65-a090c9c393a3" to garbage
    13  ```
    14  
    15  On the next pass, the pods are removed:
    16  
    17  ```
    18  # rkt gc --grace-period=30m0s
    19  Garbage collecting pod "21b1cb32-c156-4d26-82ae-eda1ab60f595"
    20  Garbage collecting pod "5dd42e9c-7413-49a9-9113-c2a8327d08ab"
    21  Garbage collecting pod "f07a4070-79a9-4db0-ae65-a090c9c393a3"
    22  ```
    23  
    24  ## Options
    25  
    26  | Flag | Default | Options | Description |
    27  | --- | --- | --- | --- |
    28  | `--expire-prepared` |  `24h0m0s` | A time | Duration to wait before expiring prepared pods |
    29  | `--grace-period` |  `30m0s` | A time | Duration to wait before discarding inactive pods from garbage |
    30  | `--mark-only` | `false` | `true` or `false` | If set to true, only the "mark" phase of the garbage collection process will be formed (i.e., exited/aborted pods will be moved to the garbage, but nothing will be deleted) |
    31  
    32  ## Global options
    33  
    34  See the table with [global options in general commands documentation][global-options].
    35  
    36  
    37  [gc-docs]: ../devel/pod-lifecycle.md#garbage-collection
    38  [global-options]: ../commands.md#global-options