<p>I'm trying to migrate my Nextcloud instance to a kubernetes cluster. I've succesfully deployed a Nextcloud instance using <strong>openEBS-cStor</strong> storage. Before I can &quot;kubectl cp&quot; my old files to the cluster, I need to put Nextcloud in maintenance mode.</p>
<p>This is what I've tried so far:</p>
<ul>
<li>Shell access to pod</li>
<li>Navigate to folder</li>
<li>Run OCC command to put next cloud in maintenance mode</li>
</ul>
<p>These are the commands I used for the OCC way:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl exec --stdin --tty -n nextcloud nextcloud-7ff9cf449d-rtlxh -- /bin/bash
su -c 'php occ maintenance:mode --on' www-data
# This account is currently not available.
</code></pre>
<p>Any tips on how to put Nextcloud in maintenance mode would be appreciated!</p>

<p>The <code>su</code> command fails because there is no shell associated with the <code>www-data</code> user.</p>
<p>What worked for me is explicitly specifying the shell in the <code>su</code> command:</p>
<pre class="lang-sh prettyprint-override"><code>su -s /bin/bash www-data -c &quot;php occ maintenance:mode --on&quot;
</code></pre>
