hassio-addon-rclone/rclone/rootfs/etc/cont-init.d/timegaps.sh

17 lines
486 B
Bash
Raw Normal View History

#! /usr/bin/with-contenv bashio
bashio::log.info "Configuring pruning with timegaps..."
TIMEGAPS_RULES=$(bashio::config 'prune.rules')
TIMEGAPS_CRON=$(bashio::config 'prune.cron')
TIMEGAPS_DELETE=""
if bashio::config.true 'prune.delete'; then
TIMEGAPS_DELETE="--delete"
fi
if [ -n "$TIMEGAPS_RULES" ] && [ -n "$TIMEGAPS_CRON" ]; then
2021-12-25 18:20:18 +00:00
COMMAND="timegaps $TIMEGAPS_DELETE $TIMEGAPS_RULES /backup/*.tar"
echo "$TIMEGAPS_CRON $COMMAND" >> /etc/crontabs/root
crontab -l
fi