Add postgresql dump

This commit is contained in:
Fliegerjohn 2023-11-22 09:20:42 +01:00
parent 6fcdf03fec
commit 59656c3f83
Signed by: fliegerjohn
GPG key ID: E2221D5FE4656B6A

View file

@ -353,6 +353,16 @@ fi
} }
#
## Take databasedump
#
postgrebackup() {
echo "Take backup of postgresql database"
sudo -Hu $postgreuser pg_dump -d $database --format=custom -f $databasedumpdir/nextcloud_`date +"%Y%m%d"`.pgdump
}
# #
## Read config ## Read config
# #
@ -417,6 +427,13 @@ case "$1" in
exit 0 exit 0
;; ;;
--backup-with-postgre)
readconfig
postgrebackup
backup
exit 0
;;
--restore) --restore)
echo "Later that comand will restore your data!" echo "Later that comand will restore your data!"
exit 0 exit 0