command_reference.md 8.2 KB
Newer Older
S
Suave Su 已提交
1 2
# Command Reference

3
There are many commands to help you manage your file system. This page provides a detailed reference for these commands.
S
Suave Su 已提交
4 5 6 7 8 9 10

## Overview

If you run `juicefs` by itself, it will print all available subcommands. In addition, you can add `-h/--help` flag after each subcommand to get more information of that subcommand.

```
NAME:
11
   juicefs - A POSIX file system built on Redis and object storage.
S
Suave Su 已提交
12 13 14 15 16

USAGE:
   juicefs [global options] command [command options] [arguments...]

VERSION:
17
   0.12.1-11 (2021-04-21 d749382)
S
Suave Su 已提交
18 19 20 21

COMMANDS:
   format     format a volume
   mount      mount a volume
22
   umount     unmount a volume
C
Changjian Gao 已提交
23
   gateway    S3-compatible gateway
24
   sync       sync between two storage
25
   rmr        remove directories recursively
26
   info       show internal information for paths or inodes
S
Suave Su 已提交
27
   benchmark  run benchmark, including read/write/stat big/small files
28 29
   gc         collect any leaked objects
   fsck       Check consistency of file system
S
Suave Su 已提交
30 31 32
   help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
33 34 35
   --verbose, --debug, -v  enable debug log (default: false)
   --quiet, -q             only warning and errors (default: false)
   --trace                 enable trace log (default: false)
36
   --no-agent              Disable pprof (:6060) and gops (:6070) agent (default: false)
37 38
   --help, -h              show help (default: false)
   --version, -V           print only the version (default: false)
S
Suave Su 已提交
39 40 41 42 43

COPYRIGHT:
   AGPLv3
```

C
Changjian Gao 已提交
44
Usage: `juicefs [global options] command [command options] [arguments...]`
S
Suave Su 已提交
45 46 47 48 49 50 51 52 53 54 55

Add `-h` or `--help` after all commands, getting arguments list and help information.

***Note:*** If `juicefs` is not placed in your `$PATH`, you should run the script with the path to the script. For example, if `juicefs` is placed in current directory, you should use `./juicefs`. It is recommended to place `juicefs` in your `$PATH` for the convenience.

The documentation below gives you detailed information about each subcommand.

## juicefs format

### Description

56
Format a volume. It's the first step for initializing a new file system volume.
S
Suave Su 已提交
57 58 59 60 61 62 63 64 65

### Synopsis

```
juicefs format [command options] REDIS-URL NAME
```

### Options

66
`--block-size value`\
S
Suave Su 已提交
67 68
size of block in KiB (default: 4096)

69
`--compress value`\
70
compression algorithm (lz4, zstd, none) (default: "none")
S
Suave Su 已提交
71

72
`--storage value`\
S
Suave Su 已提交
73 74
Object storage type (e.g. s3, gcs, oss, cos) (default: "file")

75 76
`--bucket value`\
A bucket URL to store data (default: `"$HOME/.juicefs/local"`)
S
Suave Su 已提交
77

78 79
`--access-key value`\
Access key for object storage (env `ACCESS_KEY`)
S
Suave Su 已提交
80

81 82
`--secret-key value`\
Secret key for object storage (env `SECRET_KEY`)
S
Suave Su 已提交
83

84 85 86
`--encrypt-rsa-key value`\
A path to RSA private key (PEM)

87
`--force`\
S
Suave Su 已提交
88 89 90 91 92 93
overwrite existing format (default: false)

## juicefs mount

### Description

94
Mount a volume. The volume shoud be formatted first.
S
Suave Su 已提交
95 96 97 98 99 100 101 102 103

### Synopsis

```
juicefs mount [command options] REDIS-URL MOUNTPOINT
```

### Options

104
`-d, --background`\
S
Suave Su 已提交
105 106
run in background (default: false)

107
`--no-syslog`\
S
Suave Su 已提交
108 109
disable syslog (default: false)

110
`-o value`\
111
other FUSE options (see [this document](fuse_mount_options.md) for more information)
S
Suave Su 已提交
112

113
`--attr-cache value`\
S
Suave Su 已提交
114 115
attributes cache timeout in seconds (default: 1)

116
`--entry-cache value`\
S
Suave Su 已提交
117 118
file entry cache timeout in seconds (default: 1)

119
`--dir-entry-cache value`\
S
Suave Su 已提交
120 121
dir entry cache timeout in seconds (default: 1)

122
`--enable-xattr`\
S
Suave Su 已提交
123 124
enable extended attributes (xattr) (default: false)

125
`--get-timeout value`\
S
Suave Su 已提交
126 127
the max number of seconds to download an object (default: 60)

128
`--put-timeout value`\
S
Suave Su 已提交
129 130
the max number of seconds to upload an object (default: 60)

131
`--io-retries value`\
S
Suave Su 已提交
132 133
number of retries after network failure (default: 30)

134
`--max-uploads value`\
S
Suave Su 已提交
135 136
number of connections to upload (default: 20)

137 138
`--buffer-size value`\
total read/write buffering in MiB (default: 300)
S
Suave Su 已提交
139

140
`--prefetch value`\
S
Suave Su 已提交
141 142
prefetch N blocks in parallel (default: 3)

143
`--writeback`\
C
Changjian Gao 已提交
144
upload objects in background (default: false)
S
Suave Su 已提交
145

146
`--cache-dir value`\
C
Changjian Gao 已提交
147
directory paths of local cache, use colon to separate multiple paths (default: `"$HOME/.juicefs/cache"` or `/var/jfsCache`)
S
Suave Su 已提交
148

149
`--cache-size value`\
S
Suave Su 已提交
150 151
size of cached objects in MiB (default: 1024)

152
`--free-space-ratio value`\
S
Suave Su 已提交
153 154
min free space (ratio) (default: 0.1)

155
`--cache-partial-only`\
S
Suave Su 已提交
156 157
cache only random/small read (default: false)

158
`--no-usage-report`\
S
Suave Su 已提交
159 160
do not send usage report (default: false)

D
Davies Liu 已提交
161 162 163 164
## juicefs umount

### Description

165
Unmount a volume.
D
Davies Liu 已提交
166 167 168 169 170 171 172 173 174 175

### Synopsis

```
juicefs umount [options] MOUNTPOINT
```

### Options

`-f, --force`\
176
unmount a busy mount point by force (default: false)
D
Davies Liu 已提交
177

C
Changjian Gao 已提交
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
## juicefs gateway

### Description

S3-compatible gateway.

### Synopsis

```
juicefs gateway [command options] REDIS-URL ADDRESS
```

### Options

`--get-timeout value`\
the max number of seconds to download an object (default: 60)

`--put-timeout value`\
the max number of seconds to upload an object (default: 60)

`--io-retries value`\
number of retries after network failure (default: 30)

`--max-uploads value`\
number of connections to upload (default: 20)

`--buffer-size value`\
total read/write buffering in MiB (default: 300)

`--prefetch value`\
prefetch N blocks in parallel (default: 3)

`--writeback`\
upload objects in background (default: false)

`--cache-dir value`\
directory paths of local cache, use colon to separate multiple paths (default: `"$HOME/.juicefs/cache"` or `/var/jfsCache`)

`--cache-size value`\
size of cached objects in MiB (default: 1024)

`--free-space-ratio value`\
min free space (ratio) (default: 0.1)

`--cache-partial-only`\
cache only random/small read (default: false)

`--access-log value`\
path for JuiceFS access log

`--no-usage-report`\
do not send usage report (default: false)

`--no-banner`\
disable MinIO startup information (default: false)

234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
## juicefs sync

### Description

Sync between two storage.

### Synopsis

```
juicefs sync [command options] SRC DST
```

### Options

`--start KEY, -s KEY`\
the first KEY to sync

`--end KEY, -e KEY`\
the last KEY to sync

`--threads value, -p value`\
number of concurrent threads (default: 10)

`--http-port PORT`\
HTTP PORT to listen to (default: 6070)

`--update, -u`\
update existing file if the source is newer (default: false)

`--force-update, -f`\
always update existing file (default: false)

`--perms`\
preserve permissions (default: false)

`--dirs`\
Sync directories or holders (default: false)

`--dry`\
don't copy file (default: false)

`--delete-src, --deleteSrc`\
delete objects from source after synced (default: false)

`--delete-dst, --deleteDst`\
delete extraneous objects from destination (default: false)

`--exclude PATTERN`\
exclude keys containing PATTERN (POSIX regular expressions)

`--include PATTERN`\
only include keys containing PATTERN (POSIX regular expressions)

`--manager value`\
manager address

`--worker value`\
hosts (seperated by comma) to launch worker

`--bwlimit value`\
limit bandwidth in Mbps (0 means unlimited) (default: 0)

`--no-https`\
do not use HTTPS (default: false)
D
Davies Liu 已提交
298

D
Davies Liu 已提交
299 300 301 302 303 304 305 306 307 308 309 310
## juicefs rmr

### Description

Remove all files in directories recursively.

### Synopsis

```
juicefs rmr PATH ...
```

311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328
## juicefs info

### Description

Show internal information for given paths or inodes.

### Synopsis

```
juicefs info [command options] PATH or INODE
```

### Options

`--inode, -i`\
use inode instead of path (current dir should be inside JuiceFS) (default: `false`)


S
Suave Su 已提交
329 330 331 332 333 334 335 336 337
## juicefs benchmark

### Description

Run benchmark, include read/write/stat big and small files.

### Synopsis

```
D
Davies Liu 已提交
338
juicefs benchmark [options] DIR
S
Suave Su 已提交
339 340 341 342
```

### Options

343
`--dest value`\
S
Suave Su 已提交
344 345
path to run benchmark (default: `"/jfs/benchmark"`)

346
`--block-size value`\
S
Suave Su 已提交
347 348
block size in MiB (default: 1)

349
`--bigfile-file-size value`\
S
Suave Su 已提交
350 351
size of big file in MiB (default: 1024)

352
`--smallfile-file-size value`\
S
Suave Su 已提交
353 354
size of small file in MiB (default: 0.1)

355 356
`--smallfile-count value`\
number of small files (default: 100)
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374

## juicefs gc

### Description

Collect any leaked objects.

### Synopsis

```
juicefs gc [command options] REDIS-URL
```

### Options

`--delete`\
deleted leaked objects (default: false)

D
Davies Liu 已提交
375 376 377
`--compact`\
compact all chunks with more than 1 slices (default: false).

378
`--threads value`\
D
Davies Liu 已提交
379
number threads to delete leaked objects (default: 10)
380 381 382 383 384 385 386 387 388 389 390 391

## juicefs fsck

### Description

Check consistency of file system.

### Synopsis

```
juicefs fsck [command options] REDIS-URL
```