mirror of
https://github.com/ViViDboarder/hassio-addon-rclone.git
synced 2024-11-01 02:46:35 +00:00
22 lines
534 B
Bash
Executable File
22 lines
534 B
Bash
Executable File
#! /usr/bin/with-contenv bashio
|
|
|
|
set +x
|
|
set -eo pipefail
|
|
|
|
bashio::log.info "Running timegaps..."
|
|
|
|
TIMEGAPS_RULES=$(bashio::config 'prune.rules')
|
|
TIMEGAPS_DELETE=""
|
|
if bashio::config.true 'prune.delete'; then
|
|
TIMEGAPS_DELETE="--delete"
|
|
fi
|
|
|
|
if bashio::config.true 'protected_only'; then
|
|
find /backup -name "*.tar" -exec tar -xOf "{}" ./backup.json \; \
|
|
| jq -r 'select(.protected) | "\(.slug).tar"' \
|
|
| timegaps --stdin $TIMEGAPS_DELETE "$TIMEGAPS_RULES"
|
|
else
|
|
timegaps $TIMEGAPS_DELETE "$TIMEGAPS_RULES"
|
|
fi
|
|
|