Compare commits

...

2 commits

Author SHA1 Message Date
ab99c2d0fe
Add first Nextcloud Support 2023-11-22 09:37:46 +01:00
59656c3f83
Add postgresql dump 2023-11-22 09:20:42 +01:00

View file

@ -353,6 +353,37 @@ fi
}
#
## Stop services
#
stopservices() {
if [[ "$nextcloud" = "1" ]]; then
echo "Set Nextcloud to Mainenancemode"
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --on
fi
}
#
## Start services
#
startservices() {
if [[ "$nextcloud" = "1" ]]; then
echo "Disable Nextcloud Maintenancemode"
sudo -u www-data php --define apc.enable_cli=1 /var/www/nextcloud/occ maintenance:mode --off
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 +448,15 @@ case "$1" in
exit 0
;;
--backup-with-postgre)
stopservices
readconfig
postgrebackup
backup
startservices
exit 0
;;
--restore)
echo "Later that comand will restore your data!"
exit 0