Fix include rule for protected only

This commit is contained in:
ViViDboarder 2023-12-07 09:46:36 -08:00
parent 5043434d5f
commit 7f991c490e

View File

@ -1,15 +1,16 @@
#! /usr/bin/with-contenv bashio #! /usr/bin/with-contenv bashio
set +x
set -eo pipefail
bashio::log.info "Running rclone..." bashio::log.info "Running rclone..."
SYNC_COMMAND=$(bashio::config 'sync_command') SYNC_COMMAND=$(bashio::config 'sync_command')
DESTINATION=$(bashio::config 'destination') DESTINATION=$(bashio::config 'destination')
set +x
FILTER='{"IncludeRule": ["*.tar"]}' FILTER='{"IncludeRule": ["*.tar"]}'
if bashio::config.true 'protected_only'; then 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="{\"IncludeRule\": $(find /backup -name "*.tar" -exec tar -xOf "{}" ./backup.json \;| jq -sc 'map(select(.protected) | "\(.slug).tar")')}"
fi fi
bashio::log.info "Filter: $FILTER" bashio::log.info "Filter: $FILTER"