hassio-addons/auto-snapshot/run.sh

16 lines
318 B
Bash
Raw Normal View History

2021-09-07 21:51:30 +00:00
#!/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