hassio-addons/auto-snapshot/run.sh
2019-03-11 10:13:57 +01:00

16 lines
318 B
Bash

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