hassio-addons/auto-backup/run.sh

16 lines
314 B
Bash

#!/bin/bash
set -e
CONFIG_PATH=/data/options.json
CRON=$(jq --raw-output ".cron" $CONFIG_PATH)
echo "$CRON /backup.sh >> /var/log/cron.log" > /var/spool/cron/crontabs/root
# change perms
chmod 600 /var/spool/cron/crontabs/root
echo "Auto backup ready."
crond
touch /var/log/cron.log
tail -f /var/log/cron.log