backup-bot-two/entrypoint.sh

21 lines
479 B
Bash

#!/bin/sh
set -e -o pipefail
apk add --upgrade --no-cache restic bash python3 py3-pip py3-click py3-docker-py py3-json-logger
# Todo use requirements file with specific versions
pip install --break-system-packages resticpy==1.0.2
if [ -n "$SSH_HOST_KEY" ]
then
echo "$SSH_HOST_KEY" > /root/.ssh/known_hosts
fi
cron_schedule="${CRON_SCHEDULE:?CRON_SCHEDULE not set}"
echo "$cron_schedule backup --machine-logs create" | crontab -
crontab -l
crond -f -d8 -L /dev/stdout