This repository has been archived on 2024-12-15. You can view files and clone it, but cannot push or open issues or pull requests.
kopia/run-backup.sh

14 lines
398 B
Bash
Executable File

#!/bin/bash
if [[ -v KOPIA_PG_DATABASE ]];
then
PGPASSWORD=$KOPIA_PG_PASSWORD pg_dump --host=$KOPIA_PG_HOST --username=$KOPIA_PG_USER $KOPIA_PG_DATABASE > /backup/database/$KOPIA_PG_DATABASE.sqldump || exit 1
fi
kopia repository connect filesystem \
--path /repository \
--override-hostname ${KOPIA_HOSTNAME} \
--override-username ${KOPIA_USERNAME}
kopia snapshot create /backup