Skip to content

Commit b086f29

Browse files
committed
fmt
1 parent b48daf9 commit b086f29

File tree

1 file changed

+27
-28
lines changed

1 file changed

+27
-28
lines changed

registry/coder/modules/archive/README.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ tags: [backup, archive, tar, helper]
1010

1111
This module installs small, robust scripts in your workspace to create and extract tar archives from a list of files and directories. It supports optional compression (gzip or zstd). The create command prints only the resulting archive path to stdout; operational logs go to stderr. An optional stop hook can also create an archive automatically when the workspace stops, and an optional start hook can wait for an archive on-disk and extract it on start.
1212

13-
1413
## Features
1514

1615
- Installs two commands into the workspace `$PATH`: `coder-archive-create` and `coder-archive-extract`.
@@ -28,14 +27,14 @@ Basic example:
2827

2928
```tf
3029
module "archive" {
31-
count = data.coder_workspace.me.start_count
32-
source = "registry.coder.com/coder/archive/coder"
33-
version = "0.0.1"
34-
agent_id = coder_agent.example.id
30+
count = data.coder_workspace.me.start_count
31+
source = "registry.coder.com/coder/archive/coder"
32+
version = "0.0.1"
33+
agent_id = coder_agent.example.id
3534
3635
# Paths to include in the archive (files or directories).
3736
directory = "~"
38-
paths = [
37+
paths = [
3938
"./projects",
4039
"./code",
4140
]
@@ -46,29 +45,29 @@ Customize compression and output:
4645

4746
```tf
4847
module "archive" {
49-
count = data.coder_workspace.me.start_count
50-
source = "registry.coder.com/coder/archive/coder"
51-
version = "0.0.1"
52-
agent_id = coder_agent.example.id
48+
count = data.coder_workspace.me.start_count
49+
source = "registry.coder.com/coder/archive/coder"
50+
version = "0.0.1"
51+
agent_id = coder_agent.example.id
5352
5453
directory = "/"
5554
paths = ["/etc", "/home"]
56-
compression = "zstd" # "gzip" | "zstd" | "none"
57-
output_dir = "/tmp/backup" # defaults to /tmp
58-
archive_name = "my-backup" # base name (extension is inferred from compression)
55+
compression = "zstd" # "gzip" | "zstd" | "none"
56+
output_dir = "/tmp/backup" # defaults to /tmp
57+
archive_name = "my-backup" # base name (extension is inferred from compression)
5958
}
6059
```
6160

6261
Enable auto-archive on stop:
6362

6463
```tf
6564
module "archive" {
66-
count = data.coder_workspace.me.start_count
67-
source = "registry.coder.com/coder/archive/coder"
68-
version = "0.0.1"
69-
agent_id = coder_agent.example.id
65+
count = data.coder_workspace.me.start_count
66+
source = "registry.coder.com/coder/archive/coder"
67+
version = "0.0.1"
68+
agent_id = coder_agent.example.id
7069
71-
# Creates /tmp/coder-archive.tar.gz of the users home directory (defaults).
70+
# Creates /tmp/coder-archive.tar.gz of the users home directory (defaults).
7271
create_on_stop = true
7372
}
7473
```
@@ -77,19 +76,19 @@ Extract on start:
7776

7877
```tf
7978
module "archive" {
80-
count = data.coder_workspace.me.start_count
81-
source = "registry.coder.com/coder/archive/coder"
82-
version = "0.0.1"
83-
agent_id = coder_agent.example.id
79+
count = data.coder_workspace.me.start_count
80+
source = "registry.coder.com/coder/archive/coder"
81+
version = "0.0.1"
82+
agent_id = coder_agent.example.id
8483
8584
# Where to look for the archive file to extract:
86-
output_dir = "/tmp"
87-
archive_name = "my-archive"
88-
compression = "gzip"
85+
output_dir = "/tmp"
86+
archive_name = "my-archive"
87+
compression = "gzip"
8988
90-
# Waits up to 5 minutes for /tmp/my-archive.tar.gz to be present.
91-
extract_on_start = true
92-
extract_wait_timeout_seconds = 300
89+
# Waits up to 5 minutes for /tmp/my-archive.tar.gz to be present.
90+
extract_on_start = true
91+
extract_wait_timeout_seconds = 300
9392
}
9493
```
9594

0 commit comments

Comments
 (0)