-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve commands for container-based usage
- Loading branch information
Showing
1 changed file
with
45 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,15 +46,41 @@ we'll use `./my-data` here. | |
If you have just one account, you can do as follows | ||
|
||
```sh | ||
docker run -v ./my-data:/data -ti ghcr.io/joeyates/imap-backup:latest \ | ||
imap-backup single backup \ | ||
docker run \ | ||
--volume ./my-data:/data \ | ||
--dns 8.8.8.8 \ | ||
--email [email protected] --password mysecret --server imap.example.com \ | ||
--path /data/me_example.com | ||
ghcr.io/joeyates/imap-backup:latest \ | ||
imap-backup single backup \ | ||
--email [email protected] \ | ||
--password mysecret \ | ||
--server imap.example.com \ | ||
--path /data/me_example.com | ||
``` | ||
|
||
Podman will work exactly the same. | ||
|
||
Notes: | ||
|
||
* If you're using Docker, add `--user $(id -u):$(id -g)` so that the files | ||
created by the container are owned by you and not by root, | ||
* Pass imap-backup the `--password-environment-variable=VARIABLE_NAME` or | ||
`--password-file=FILE` option to avoid having your password in | ||
the command line history: | ||
|
||
docker run --env THE_PASSWORD=$THE_PASSWORD \ | ||
... \ | ||
imap-backup single backup \ | ||
--password-environment-variable=THE_PASSWORD \ | ||
... | ||
|
||
or | ||
|
||
docker run \ | ||
... \ | ||
imap-backup single backup \ | ||
--password-file=/data/password.txt \ | ||
... | ||
|
||
If you have multiple accounts, you can create a configuration file. | ||
|
||
You'll need to choose a path on your computer where your configuration will be saved, | ||
|
@@ -63,16 +89,27 @@ we'll use `./my-config` here. | |
First, run the menu-driven setup program to configure your accounts | ||
|
||
```sh | ||
docker run -v ./my-config:/config -v ./my-data:/data -ti ghcr.io/joeyates/imap-backup:latest \ | ||
docker run \ | ||
--volume ./my-config:/config \ | ||
--volume ./my-data:/data \ | ||
--dns 8.8.8.8 \ | ||
imap-backup setup -c /config/imap-backup.json | ||
--tty \ | ||
--interactive \ | ||
ghcr.io/joeyates/imap-backup:latest \ | ||
imap-backup setup \ | ||
--config /config/imap-backup.json | ||
``` | ||
|
||
Then, run the backup | ||
|
||
```sh | ||
docker run -v ./my-config:/config -v ./my-data:/data --dns 8.8.8.8 -ti ghcr.io/joeyates/imap-backup:latest \ | ||
imap-backup backup -c /config/imap-backup.json | ||
docker run \ | ||
--volume ./my-config:/config \ | ||
--volume ./my-data:/data \ | ||
--dns 8.8.8.8 \ | ||
ghcr.io/joeyates/imap-backup:latest \ | ||
imap-backup backup \ | ||
--config /config/imap-backup.json | ||
``` | ||
</details> | ||
|
||
|