|
@@ -60,17 +60,6 @@ if type "pg_dump" > /dev/null; then
|
|
|
fi
|
|
|
fi
|
|
|
|
|
|
-# Backup PostgreSQL data if pg_dump is available
|
|
|
-if type "pg_dump" > /dev/null; then
|
|
|
- PG_DBS=`sudo -i -u postgres psql template1 -t -c "SELECT datname FROM pg_database WHERE datname NOT LIKE 'template_'"`
|
|
|
- for PG_DB in $PG_DBS
|
|
|
- do
|
|
|
- PG_BACKUP=`sudo -u postgres mktemp -t pg_dump_XXXX`
|
|
|
- sudo -u postgres -i pg_dump -Z3 -Fc "${PG_DB}" > "${PG_BACKUP}"
|
|
|
- mv "${PG_BACKUP}" "${BACKUP_TEMP}/pgsql_${PG_DB}_Fc.dump"
|
|
|
- done
|
|
|
-fi
|
|
|
-
|
|
|
if [ ! -d "${BACKUP_DEST}" ]; then
|
|
|
# Initialize local borg repository
|
|
|
borg init --encryption=none "${BACKUP_DEST}"
|