File size: 814 Bytes
c2904e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Scripts Usage

This directory contains maintenance utilities for the project.

## Table of Contents

- [dump_lmdb.py](#dump_lmdbpy)
- [rotate_lmdb.py](#rotate_lmdbpy)

## dump_lmdb.py

Dump records from an LMDB database as a JSON array. If no keys are provided, the script outputs every record. When keys are supplied, only the specified records are returned.

### Usage

Dump all entries:

```bash
python scripts/dump_lmdb.py /path/to/lmdb
```

Dump specific keys:

```bash
python scripts/dump_lmdb.py /path/to/lmdb key1 key2
```

## rotate_lmdb.py

Delete LMDB records older than a given duration or remove all records.

### Usage

Delete entries older than 14 days:

```bash
python scripts/rotate_lmdb.py /path/to/lmdb 14d
```

Delete all entries:

```bash
python scripts/rotate_lmdb.py /path/to/lmdb all
```