mirror of
https://github.com/ViViDboarder/docker-restic-cron.git
synced 2024-11-14 17:26:47 +00:00
19 lines
283 B
Bash
Executable File
19 lines
283 B
Bash
Executable File
#! /bin/bash
|
|
|
|
ENV=/env.sh
|
|
LOG=/cron.log
|
|
HEALTH_FILE=/unhealthy
|
|
|
|
if [ -f "$ENV" ]; then
|
|
# shellcheck disable=SC1090
|
|
source "$ENV"
|
|
fi
|
|
|
|
# Execute command and write output to log
|
|
if eval "$@" 2>> "$LOG"; then
|
|
rm -f "$HEALTH_FILE"
|
|
else
|
|
touch "$HEALTH_FILE"
|
|
exit 1;
|
|
fi
|