2023-08-18 19:19:37 +00:00
|
|
|
#!/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
|
2023-08-17 15:00:22 +00:00
|
|
|
|
2023-08-17 15:36:27 +00:00
|
|
|
kopia repository connect filesystem \
|
|
|
|
--path /repository \
|
|
|
|
--override-hostname ${KOPIA_HOSTNAME} \
|
|
|
|
--override-username ${KOPIA_USERNAME}
|
|
|
|
|
2023-08-17 15:00:22 +00:00
|
|
|
kopia snapshot create /backup
|