mirror of
https://github.com/ViViDboarder/hassio-addon-rclone.git
synced 2024-10-31 18:36:35 +00:00
Add protected_only option to filter out unencrypted files
This commit is contained in:
parent
d47cbf146e
commit
4760360df6
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
## next
|
## next
|
||||||
- Bump rclone version to v1.64.2
|
- Bump rclone version to v1.64.2
|
||||||
|
- Add `protected_only` option to filter out unencrypted backups
|
||||||
|
|
||||||
## 1.5.5
|
## 1.5.5
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ COPY install_rclone.sh /
|
|||||||
RUN /install_rclone.sh "${VERSION}" "${BUILD_ARCH}"
|
RUN /install_rclone.sh "${VERSION}" "${BUILD_ARCH}"
|
||||||
|
|
||||||
# Add timegaps for pruning backups
|
# Add timegaps for pruning backups
|
||||||
RUN apk add --no-cache python3 py3-pip && \
|
RUN apk add --no-cache python3 py3-pip jq && \
|
||||||
pip install --no-cache-dir timegaps==0.1.1 && \
|
pip install --no-cache-dir timegaps==0.1.1 && \
|
||||||
apk del py3-pip
|
apk del py3-pip
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ options:
|
|||||||
ssl: false
|
ssl: false
|
||||||
certfile: fullchain.pem
|
certfile: fullchain.pem
|
||||||
keyfile: privkey.pem
|
keyfile: privkey.pem
|
||||||
|
protected_only:: false
|
||||||
schema:
|
schema:
|
||||||
cron: str
|
cron: str
|
||||||
destination: str
|
destination: str
|
||||||
@ -50,3 +51,4 @@ schema:
|
|||||||
ssl: bool
|
ssl: bool
|
||||||
certfile: str
|
certfile: str
|
||||||
keyfile: str
|
keyfile: str
|
||||||
|
protected_only: bool
|
||||||
|
@ -13,7 +13,12 @@ DESTINATION=$(bashio::config 'destination')
|
|||||||
|
|
||||||
USERNAME=$(bashio::config 'credentials.username')
|
USERNAME=$(bashio::config 'credentials.username')
|
||||||
PASSWORD=$(bashio::config 'credentials.password')
|
PASSWORD=$(bashio::config 'credentials.password')
|
||||||
|
|
||||||
FILTER='{"IncludeRule": ["*.tar"]}'
|
FILTER='{"IncludeRule": ["*.tar"]}'
|
||||||
|
if bashio::config.true 'protected_only'; then
|
||||||
|
FILTER="{\"IncludeRule\": $(find /backup -name "*.tar" -exec tar -xOf "{}" ./backup.json \;| jq -sc 'map(select(.protected) | "/backup/\(.slug).tar")')}"
|
||||||
|
FILTER=
|
||||||
|
fi
|
||||||
|
|
||||||
command="rclone rc --user \"$USERNAME\" --pass \"$PASSWORD\" sync/$SYNC_COMMAND srcFs=/backup dstFs=$DESTINATION _async=true _filter='$FILTER'"
|
command="rclone rc --user \"$USERNAME\" --pass \"$PASSWORD\" sync/$SYNC_COMMAND srcFs=/backup dstFs=$DESTINATION _async=true _filter='$FILTER'"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user