#!/bin/sh
#-----------------------------------------------------------------------------
# /var/install/bin/postgresql17-tools-backup-server
#
# Creation:     2019-03-31 dv
# Last Update:  2024-11-28 23:30:06
#
# Copyright (c) 2024 the eisfair team, team(at)eisfair(dot)org
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#-----------------------------------------------------------------------------

#include eislib
. /var/install/include/eislib
. /etc/config.d/postgresql17

/var/install/bin/postgresql-common-backup-server  \
   --interactive                              \
   --prefix="pgsql17"                         \
   --user="postgres"                          \
   --mount="${POSTGRESQL17_BACKUP_MOUNT}"     \
   --umount="${POSTGRESQL17_BACKUP_UMOUNT}"   \
   --folder="${POSTGRESQL17_BACKUP_TARGET}"   \
   --port="${POSTGRESQL17_CONNECT_PORT}"      \
   --file-limit="3"

result="$?"

if [ "${result}" = "0" ]
then
    anykey
fi

exit ${result}