Tools to make local backups of hosted services.
PATH must contain a sufficiently new pg_dump. See https://www.postgresql.org/download/
BorgBackup must be installed. Distribution packages are recommended. See: https://borgbackup.readthedocs.io/en/stable/installation.html
Create one user for each cloud or local cluster of databases.
A directory with sufficient disk space must be available. Recommended is to create directories and mount filesystems under /srv.
A borg repo must be initialized:
export BORG_REPO=/srv/cloudbackup/azure/mycloud
borg init -e none
For example:
cloudbackup backup postgres host <conn>
conn is according to https://www.postgresql.org/docs/10/static/libpq-connect.html#LIBPQ-CONNSTRING It should not contain a password, use ~/.pgpass instead.
Monitor the exit code from the command and log its output.