From 59656c3f83db97749077222f9202e4d0e769bac2 Mon Sep 17 00:00:00 2001 From: fliegerjohn Date: Wed, 22 Nov 2023 09:20:42 +0100 Subject: [PATCH] Add postgresql dump --- abackup.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/abackup.sh b/abackup.sh index a81b27e..88b57b2 100755 --- a/abackup.sh +++ b/abackup.sh @@ -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 # @@ -417,6 +427,13 @@ case "$1" in exit 0 ;; + --backup-with-postgre) + readconfig + postgrebackup + backup + exit 0 + ;; + --restore) echo "Later that comand will restore your data!" exit 0