diff --git a/README.md b/README.md index 514f40a..d696921 100644 --- a/README.md +++ b/README.md @@ -479,6 +479,15 @@ We recommend re-downloading the `docker-compose.yml` file, replacing your enviro +## Advance + +- [Run as non-root user](docs/run-as-non-root-user.md) +- [Multiple remote destinations](docs/multiple-remote-destinations.md) + +
+ + + ## Changelog Check out [CHANGELOG](CHANGELOG.md) file. diff --git a/README_zh.md b/README_zh.md index f1d1af9..f485082 100644 --- a/README_zh.md +++ b/README_zh.md @@ -476,6 +476,15 @@ docker run --rm -it -e MAIL_SMTP_VARIABLES='' -e MAIL_TO='< +## 高级 + +- [以非 root 用户运行](docs/run-as-non-root-user.md) +- [备份到多个远程目标](docs/multiple-remote-destinations.md) + +
+ + + ## 更新日志 请查看 [CHANGELOG](CHANGELOG.md) 文件。 diff --git a/docs/multiple-remote-destinations.md b/docs/multiple-remote-destinations.md new file mode 100644 index 0000000..53f69e5 --- /dev/null +++ b/docs/multiple-remote-destinations.md @@ -0,0 +1,89 @@ +# Multiple remote destinations + +Some users want to upload to multiple remote destinations when backing up. + +You can do this by setting the following environment variables. + +
+ + + +## Usage + +Set additional remote destinations via environment variables `RCLONE_REMOTE_NAME_N` and `RCLONE_REMOTE_DIR_N`. + +Note: + +- `N` is the serial number, which is a number +- `N` starts from 1 and is consecutive, e.g. 1 2 3 4 5 ... +- `RCLONE_REMOTE_NAME_N` and `RCLONE_REMOTE_DIR_N` cannot be empty + +The script will break parsing of environment variables for remote destinations where the serial number is not consecutive or the value is empty. + +
+ + + +#### Example + +```yml +... +environment: + # they have default values + # RCLONE_REMOTE_NAME: BitwardenBackup + # RCLONE_REMOTE_DIR: /BitwardenBackup/ + RCLONE_REMOTE_NAME_1: extraRemoteName1 + RCLONE_REMOTE_DIR_1: extraRemoteDir1 +... +``` + +Both remote destinations are available, they are `BitwardenBackup:/BitwardenBackup/` and `extraRemoteName1:extraRemoteDir1`. + +
+ +```yml +... +environment: + RCLONE_REMOTE_NAME: remoteName + RCLONE_REMOTE_DIR: remoteDir + RCLONE_REMOTE_NAME_1: extraRemoteName1 + RCLONE_REMOTE_DIR_1: extraRemoteDir1 + RCLONE_REMOTE_NAME_2: extraRemoteName2 + RCLONE_REMOTE_DIR_2: extraRemoteDir2 + RCLONE_REMOTE_NAME_3: extraRemoteName3 + RCLONE_REMOTE_DIR_3: extraRemoteDir3 + RCLONE_REMOTE_NAME_4: extraRemoteName4 + RCLONE_REMOTE_DIR_4: extraRemoteDir4 +... +``` + +All 5 remote destinations are available. + +
+ +```yml +... +environment: + RCLONE_REMOTE_NAME: remoteName + RCLONE_REMOTE_DIR: remoteDir + RCLONE_REMOTE_NAME_1: extraRemoteName1 + RCLONE_REMOTE_DIR_1: extraRemoteDir1 + RCLONE_REMOTE_NAME_2: extraRemoteName2 + # RCLONE_REMOTE_DIR_2: extraRemoteDir2 + RCLONE_REMOTE_NAME_3: extraRemoteName3 + RCLONE_REMOTE_DIR_3: extraRemoteDir3 + RCLONE_REMOTE_NAME_4: extraRemoteName4 + RCLONE_REMOTE_DIR_4: extraRemoteDir4 +... +``` + +`RCLONE_REMOTE_DIR_2` is not defined, so only the remote destination before it is available. They are `remoteName:remoteDir` and `extraRemoteName1:extraRemoteDir1`. + +
+ + + +## Notification + +- success: **all** remote destinations were uploaded successfully +- failure: **any** of the remote destinations failed to upload