git.p6c8.net
/
nextcloud-backup-restore.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request 'Setup script' (#19) from auto-setup into master
[nextcloud-backup-restore.git]
/
NextcloudBackup.sh
diff --git
a/NextcloudBackup.sh
b/NextcloudBackup.sh
index d1b1ed2a403866ff2172e619a7746eee8c30446c..47abd1329cabc5839c849d351c643657e3eab486 100644
(file)
--- a/
NextcloudBackup.sh
+++ b/
NextcloudBackup.sh
@@
-3,7
+3,7
@@
#
# Bash script for creating backups of Nextcloud.
#
#
# Bash script for creating backups of Nextcloud.
#
-# Version
1.1
.0
+# Version
2.0
.0
#
# Usage:
# - With backup directory specified in the script: ./NextcloudBackup.sh
#
# Usage:
# - With backup directory specified in the script: ./NextcloudBackup.sh
@@
-48,7
+48,7
@@
webserverServiceName='nginx'
# TODO: Your web server user
webserverUser='www-data'
# TODO: Your web server user
webserverUser='www-data'
-# TODO: The name of the database system (o
m
e of: mysql, mariadb, postgresql)
+# TODO: The name of the database system (o
n
e of: mysql, mariadb, postgresql)
databaseSystem='mariadb'
# TODO: Your Nextcloud database name
databaseSystem='mariadb'
# TODO: Your Nextcloud database name
@@
-63,7
+63,7
@@
dbPassword='mYpAsSw0rd'
# TODO: The maximum number of backups to keep (when set to 0, all backups are kept)
maxNrOfBackups=0
# TODO: The maximum number of backups to keep (when set to 0, all backups are kept)
maxNrOfBackups=0
-# TODO: Ignore updater's backup directory in the data directory to sa
f
e space
+# TODO: Ignore updater's backup directory in the data directory to sa
v
e space
# Set to true to ignore the backup directory
ignoreUpdaterBackups=false
# Set to true to ignore the backup directory
ignoreUpdaterBackups=false
@@
-101,6
+101,11
@@
function CtrlC() {
echo "Maintenance mode still enabled."
fi
echo "Maintenance mode still enabled."
fi
+ echo "Starting web server..."
+ systemctl start "${webserverServiceName}"
+ echo "Done"
+ echo
+
exit 1
}
exit 1
}
@@
-190,11
+195,11
@@
if [ "${databaseSystem,,}" = "mysql" ] || [ "${databaseSystem,,}" = "mariadb" ];
echo "Done"
echo
echo "Done"
echo
-elif [ "${databaseSystem,,}" = "postgresql" ]; then
+elif [ "${databaseSystem,,}" = "postgresql" ]
|| [ "${databaseSystem,,}" = "pgsql" ]
; then
echo "Backup Nextcloud database (PostgreSQL)..."
if ! [ -x "$(command -v pg_dump)" ]; then
echo "Backup Nextcloud database (PostgreSQL)..."
if ! [ -x "$(command -v pg_dump)" ]; then
- errorecho "ERROR:PostgreSQL not installed (command pg_dump not found)."
+ errorecho "ERROR:
PostgreSQL not installed (command pg_dump not found)."
errorecho "ERROR: No backup of database possible!"
else
PGPASSWORD="${dbPassword}" pg_dump "${nextcloudDatabase}" -h localhost -U "${dbUser}" -f "${backupdir}/${fileNameBackupDb}"
errorecho "ERROR: No backup of database possible!"
else
PGPASSWORD="${dbPassword}" pg_dump "${nextcloudDatabase}" -h localhost -U "${dbUser}" -f "${backupdir}/${fileNameBackupDb}"
patrick-canterino.de