nextcloud: Ignoriere Verzeichnise beim Update

This commit is contained in:
phil 2022-03-04 15:11:44 +01:00
parent ab4612c836
commit 69ecb2e1fd

View file

@ -6,42 +6,39 @@ NEXTCLOUD_ROOT="{{ nextcloud_root }}"
UPDATER="updater/updater.phar" UPDATER="updater/updater.phar"
update_db() { update_db() {
for j in `find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d` for j in $(find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d -not -path "$NEXTCLOUD_ROOT/mail2deck"); do
do USER=$(stat -c %U "$j")
USER=$(stat -c %U "$j") echo "Aktualisiere $j..."
echo "Aktualisiere $j..." sudo -u "$USER" php "$j"/occ db:convert-filecache-bigint --no-interaction
sudo -u "$USER" php "$j"/occ db:convert-filecache-bigint --no-interaction sudo -u "$USER" php "$j"/occ db:add-missing-indices --no-interaction
sudo -u "$USER" php "$j"/occ db:add-missing-indices --no-interaction done
done
} }
update_apps() { update_apps() {
for k in `find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d` for k in $(find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d -not -path "$NEXTCLOUD_ROOT/mail2deck"); do
do USER=$(stat -c %U "$k")
USER=$(stat -c %U "$k") echo "Aktualisiere $k..."
echo "Aktualisiere $k..." sudo -u "$USER" php "$k"/occ app:update --all
sudo -u "$USER" php "$k"/occ app:update --all done
done
} }
case "$1" in case "$1" in
all) all)
for i in `find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d` for i in $(find "$NEXTCLOUD_ROOT" -maxdepth 1 -mindepth 1 -type d -not -path "$NEXTCLOUD_ROOT/mail2deck"); do
do USER=$(stat -c %U "$i")
USER=$(stat -c %U "$i") echo "Aktualisiere $i..."
echo "Aktualisiere $i..." sudo -u "$USER" php "$i"/"$UPDATER" --no-interaction
sudo -u "$USER" php "$i"/"$UPDATER" --no-interaction done
done update_apps
update_apps update_db
update_db ;;
;; apps)
apps) update_apps
update_apps ;;
;; db)
db) update_db
update_db ;;
;; *)
*) echo "Usage: nextcloud-updater {all|apps|db}"
echo "Usage: nextcloud-updater {all|apps|db}" exit 1
exit 1
esac esac