Files
dockerfiles/vaultwarden-backup/app/entrypoint.sh
Uwe Hermann d4a123c19a
Some checks failed
Test stage / check and test (push) Failing after 6s
* MOD: cleanup
Signed-off-by: Uwe Hermann <uh@uleenucks.de>
2024-01-21 09:17:52 +01:00

39 lines
786 B
Bash

#!/bin/bash
# shellcheck source=/dev/null
. /app/includes.sh
# restore
if [[ "$1" == "restore" ]]; then
#. /app/restore.sh
#shift
#restore $*
echo "not implemented yet"
exit 0
fi
function configure_cron() {
local FIND_CRON_COUNT
FIND_CRON_COUNT="$(grep -c 'backup.sh' "${CRON_CONFIG_FILE}" 2> /dev/null)"
if [[ "${FIND_CRON_COUNT}" -eq 0 ]]; then
echo "${CRON} bash /app/backup.sh" >> "${CRON_CONFIG_FILE}"
fi
}
init_env
configure_postgresql
configure_cron
# backup manually
if [[ "$1" == "backup" ]]; then
echo "Manually triggering a backup will only execute the backup script once, and the container will exit upon completion."
bash "/app/backup.sh"
exit 0
fi
# foreground run crond
exec supercronic -passthrough-logs -quiet "${CRON_CONFIG_FILE}"