---
title: "oz0-node drain"
description: "Usage and flags for oz0-node drain."
canonical_url: "https://docs.oz0.ai/reference/cli/oz0-node/drain"
---
# oz0-node drain

> Usage and flags for oz0-node drain.

For: Operators and developers looking up a command.

Ask the node that runs with this data directory to drain, as it does when it is stopped: it takes no new job and starts no new session, and what runs finishes within its stop grace. The node keeps running; stop it afterwards, and its stop waits only for what is left of the same grace. With --wait, return once nothing runs there or the grace has passed. A Kubernetes pod's preStop hook runs this.

## Usage

```bash
oz0-node drain [flags]
```

## Flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --timeout
      </code>
    </td>
    
    <td>
      duration
    </td>
    
    <td>
      <code>
        1h0m0s
      </code>
    </td>
    
    <td>
      the longest --wait waits
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --wait
      </code>
    </td>
    
    <td>
      bool
    </td>
    
    <td>
      
    </td>
    
    <td>
      wait until nothing runs on the node, or its stop grace has passed
    </td>
  </tr>
</tbody>
</table>

## Inherited flags

<table>
<thead>
  <tr>
    <th>
      Flag
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        --data-dir
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        ~/.local/share/orchestrator-zero-node
      </code>
    </td>
    
    <td>
      where the node keeps its identity, uv, Python, runtimes and state
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        --log-level
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      <code>
        info
      </code>
    </td>
    
    <td>
      log level: debug, info, warn or error
    </td>
  </tr>
</tbody>
</table>

See [all `oz0-node` commands](https://docs.oz0.ai/reference/cli/oz0-node) and the [global flags](https://docs.oz0.ai/reference/cli/oz0-node#global-flags).


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
