1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

株式会社クラスアクトAdvent Calendar 2022

Day 6

kubernetesで動いているNextCloudのoccコマンドを実行する

Last updated at Posted at 2022-12-06

kubernetes上に構築したNextCloudでoccコマンドを実行する際に手間取ることが多かったのでメモ。
イメージは https://hub.docker.com/_/nextcloud を利用。
kubectl exec -it nextcloud-XXXX -- /bin/bashでログインしてからsu -s /bin/bash ~を実行しても良いですが、kubectlから直接実行するパターンで。
ポイントはsu -s /bin/bash www-data -cの部分。これをよく忘れます。

occ files:scanの例

$ kubectl exec -it nextcloud-d8dxxcc9f-md5pc -- su -s /bin/bash www-data -c "php occ files:scan --all"

あとはfiles:scan --allの部分をやりたいものに置き換えればOK

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?