+Update-Skript
This commit is contained in:
parent
6c0cc4e5b9
commit
b16548cabf
3 changed files with 41 additions and 1 deletions
33
templates/nextcloud-updater.j2
Normal file
33
templates/nextcloud-updater.j2
Normal file
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
NEXTCLOUD_ROOT="{{ nextcloud_root }}"
|
||||
UPDATER="updater/updater.phar"
|
||||
|
||||
update_db() {
|
||||
for j in `find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d`
|
||||
do
|
||||
USER=$(stat -c %U "$j")
|
||||
echo "Aktualisiere $j..."
|
||||
sudo -u "$USER" php "$j"/occ db:convert-filecache-bigint --no-interaction
|
||||
sudo -u "$USER" php "$j"/occ db:add-missing-indices --no-interaction
|
||||
done
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
core-update)
|
||||
for i in `find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d`
|
||||
do
|
||||
USER=$(stat -c %U "$i")
|
||||
echo "Aktualisiere $i..."
|
||||
sudo -u "$USER" php "$i"/"$UPDATER" --no-interaction
|
||||
done
|
||||
;;
|
||||
db-update)
|
||||
update_db
|
||||
;;
|
||||
*)
|
||||
echo "Usage: nextcloud-updater {core-update|db-update}"
|
||||
exit 1
|
||||
esac
|
Loading…
Add table
Add a link
Reference in a new issue