Compare commits
2 commits
main
...
add-suppor
Author | SHA1 | Date | |
---|---|---|---|
ab99c2d0fe | |||
59656c3f83 |
1 changed files with 40 additions and 0 deletions
40
abackup.sh
40
abackup.sh
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue