hassio-addon-rclone/rclone/rootfs/etc/cont-init.d/rclone.sh
ViViDboarder f678ec65b9 Initial addition of timegaps pruning
Might want to move from two cron tasks to a single one where rclone and prune are executed sequentially
2021-11-29 10:39:52 -08:00

21 lines
680 B
Bash
Executable File

#! /usr/bin/with-contenv bashio
bashio::log.info "Configuring rclone..."
bashio::config.require.username 'credentials.username'
bashio::config.require.password 'credentials.password'
bashio::config.suggest.true 'tls.ssl'
bashio::config.require.ssl 'tls' 'tls.certfile' 'tls.keyfile'
SYNC_COMMAND=$(bashio::config 'sync_command')
DESTINATION=$(bashio::config 'destination')
USERNAME=$(bashio::config 'credentials.username')
PASSWORD=$(bashio::config 'credentials.password')
command="rclone rc --user \"$USERNAME\" --pass \"$PASSWORD\" sync/$SYNC_COMMAND srcFs=/backup dstFs=$DESTINATION _async=true"
echo "$(bashio::config 'cron') $command" >> /etc/crontabs/root
crontab -l