2020-11-11 19:56:16 +01:00
---
title: "Compress"
description: "Compression Remote"
2022-12-20 21:05:05 +01:00
versionIntroduced: "v1.54"
2022-11-19 13:33:15 +01:00
status: Experimental
2020-11-11 19:56:16 +01:00
---
2022-11-19 13:33:15 +01:00
# {{< icon "fas fa-compress" >}} Compress
2020-11-11 19:56:16 +01:00
2021-10-14 15:40:18 +02:00
## Warning
2025-08-25 00:00:48 +02:00
This remote is currently **experimental** . Things may break and data may be lost.
Anything you do with this remote is at your own risk. Please understand the risks
associated with using experimental code and don't use this remote in critical
applications.
2021-01-17 02:31:30 +01:00
2025-08-25 00:00:48 +02:00
The `Compress` remote adds compression to another remote. It is best used with
remotes containing many large compressible files.
2020-11-11 19:56:16 +01:00
2021-10-14 15:40:18 +02:00
## Configuration
2025-08-25 00:00:48 +02:00
To use this remote, all you need to do is specify another remote and a
compression mode to use:
2020-11-11 19:56:16 +01:00
2025-08-25 00:00:48 +02:00
```text
2025-11-04 21:50:56 +07:00
$ rclone config
2020-11-11 19:56:16 +01:00
Current remotes:
Name Type
==== ====
remote_to_press sometype
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> n
name> compress
2025-11-04 21:50:56 +07:00
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
2020-11-11 19:56:16 +01:00
...
2025-11-04 21:50:56 +07:00
12 / Compress a remote
\ (compress)
2020-11-11 19:56:16 +01:00
...
Storage> compress
2025-11-04 21:50:56 +07:00
Option remote.
2020-11-11 19:56:16 +01:00
Remote to compress.
2025-11-04 21:50:56 +07:00
Enter a value.
2020-11-11 19:56:16 +01:00
remote> remote_to_press:subdir
2025-11-04 21:50:56 +07:00
Option mode.
2020-11-11 19:56:16 +01:00
Compression mode.
2025-11-04 21:50:56 +07:00
Choose a number from below, or type in your own value of type string.
Press Enter for the default (gzip).
1 / Standard gzip compression with fastest parameters.
\ (gzip)
2 / Zstandard compression — fast modern algorithm offering adjustable speed-to-compression tradeoffs.
\ (zstd)
mode> gzip
Option level.
GZIP (levels -2 to 9):
- -2 — Huffman encoding only. Only use if you know what you're doing.
- -1 (default) — recommended; equivalent to level 5.
- 0 — turns off compression.
- 1–9 — increase compression at the cost of speed. Going past 6 generally offers very little return.
ZSTD (levels 0 to 4):
- 0 — turns off compression entirely.
- 1 — fastest compression with the lowest ratio.
- 2 (default) — good balance of speed and compression.
- 3 — better compression, but uses about 2–3x more CPU than the default.
- 4 — best possible compression ratio (highest CPU cost).
Notes:
- Choose GZIP for wide compatibility; ZSTD for better speed/ratio tradeoffs.
- Negative gzip levels: -2 = Huffman-only, -1 = default (≈ level 5).
Enter a value.
level> -1
Edit advanced config?
2020-11-11 19:56:16 +01:00
y) Yes
n) No (default)
y/n> n
2025-11-04 21:50:56 +07:00
Configuration complete.
Options:
- type: compress
- remote: remote_to_press:subdir
- mode: gzip
- level: -1
Keep this "compress" remote?
2020-11-11 19:56:16 +01:00
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
```
2025-11-04 21:50:56 +07:00
### Compression Algorithms
2021-10-14 15:40:18 +02:00
2025-11-04 21:50:56 +07:00
- **GZIP** – a well-established and widely adopted algorithm that strikes a solid balance between compression speed and ratio. It supports compression levels from -2 to 9, with the default -1 (roughly equivalent to level 5) offering an effective middle ground for most scenarios.
- **Zstandard (zstd)** – a modern, high-performance algorithm that offers precise control over the trade-off between speed and compression efficiency. Compression levels range from 0 (no compression) to 4 (maximum compression).
2020-11-11 19:56:16 +01:00
2021-10-14 15:40:18 +02:00
### File types
2025-08-25 00:00:48 +02:00
If you open a remote wrapped by compress, you will see that there are many
files with an extension corresponding to the compression algorithm you chose.
These files are standard files that can be opened by various archive programs,
2020-11-11 19:56:16 +01:00
but they have some hidden metadata that allows them to be used by rclone.
2025-08-25 00:00:48 +02:00
While you may download and decompress these files at will, do **not** manually
delete or rename files. Files without correct metadata files will not be
recognized by rclone.
2020-11-11 19:56:16 +01:00
### File names
2025-08-25 00:00:48 +02:00
The compressed files will be named `*.###########.gz` where `*` is the base
file and the `#` part is base64 encoded size of the uncompressed file. The file
names should not be changed by anything other than the rclone compression backend.
2020-11-11 19:56:16 +01:00
2025-11-04 14:56:55 +01:00
<!-- autogenerated options start - DO NOT EDIT - instead edit fs.RegInfo in backend/compress/compress.go and run make backenddocs to verify --> <!-- markdownlint - disable - line line - length -->
2021-11-01 15:42:05 +00:00
### Standard options
2020-11-11 19:56:16 +01:00
2022-07-09 18:08:20 +01:00
Here are the Standard options specific to compress (Compress a remote).
2020-11-11 19:56:16 +01:00
#### --compress-remote
Remote to compress.
2022-03-18 12:29:54 +00:00
Properties:
2020-11-11 19:56:16 +01:00
- Config: remote
- Env Var: RCLONE_COMPRESS_REMOTE
- Type: string
2022-03-18 12:29:54 +00:00
- Required: true
2020-11-11 19:56:16 +01:00
#### --compress-mode
Compression mode.
2022-03-18 12:29:54 +00:00
Properties:
2020-11-11 19:56:16 +01:00
- Config: mode
- Env Var: RCLONE_COMPRESS_MODE
- Type: string
- Default: "gzip"
- Examples:
- "gzip"
- Standard gzip compression with fastest parameters.
2025-11-04 21:50:56 +07:00
- "zstd"
- Zstandard compression — fast modern algorithm offering adjustable speed-to-compression tradeoffs.
2020-11-11 19:56:16 +01:00
#### --compress-level
2025-11-04 21:50:56 +07:00
GZIP (levels -2 to 9):
- -2 — Huffman encoding only. Only use if you know what you're doing.
- -1 (default) — recommended; equivalent to level 5.
- 0 — turns off compression.
- 1–9 — increase compression at the cost of speed. Going past 6 generally offers very little return.
ZSTD (levels 0 to 4):
- 0 — turns off compression entirely.
- 1 — fastest compression with the lowest ratio.
- 2 (default) — good balance of speed and compression.
- 3 — better compression, but uses about 2–3x more CPU than the default.
- 4 — best possible compression ratio (highest CPU cost).
Notes:
- Choose GZIP for wide compatibility; ZSTD for better speed/ratio tradeoffs.
- Negative gzip levels: -2 = Huffman-only, -1 = default (≈ level 5).
2020-11-11 19:56:16 +01:00
2022-03-18 12:29:54 +00:00
Properties:
2020-11-11 19:56:16 +01:00
- Config: level
- Env Var: RCLONE_COMPRESS_LEVEL
2025-11-04 21:50:56 +07:00
- Type: string
- Required: true
### Advanced options
Here are the Advanced options specific to compress (Compress a remote).
2020-11-11 19:56:16 +01:00
2021-02-02 13:42:35 +00:00
#### --compress-ram-cache-limit
Some remotes don't allow the upload of files with unknown size.
2021-11-01 15:42:05 +00:00
In this case the compressed file will need to be cached to determine
it's size.
Files smaller than this limit will be cached in RAM, files larger than
this limit will be cached on disk.
2021-02-02 13:42:35 +00:00
2022-03-18 12:29:54 +00:00
Properties:
2021-02-02 13:42:35 +00:00
- Config: ram_cache_limit
- Env Var: RCLONE_COMPRESS_RAM_CACHE_LIMIT
- Type: SizeSuffix
2021-07-20 19:45:41 +01:00
- Default: 20Mi
2021-02-02 13:42:35 +00:00
2024-03-10 11:22:43 +00:00
#### --compress-description
2024-06-14 16:04:51 +01:00
Description of the remote.
2024-03-10 11:22:43 +00:00
Properties:
- Config: description
- Env Var: RCLONE_COMPRESS_DESCRIPTION
- Type: string
- Required: false
2022-07-09 18:08:20 +01:00
### Metadata
Any metadata supported by the underlying remote is read and written.
See the [metadata ](/docs/#metadata ) docs for more info.
2025-11-04 14:56:55 +01:00
<!-- autogenerated options stop -->