Add postgresql dump
This commit is contained in:
parent
6fcdf03fec
commit
59656c3f83
1 changed files with 17 additions and 0 deletions
17
abackup.sh
17
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
|
## 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
|
||||||
|
|
Loading…
Reference in a new issue