<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Wrong directory for previewcleanup cron job]]></title><description><![CDATA[<p dir="auto">The cron job previewcleanup with the script <code>/app/pkg/preview-cleanup.sh</code> tries to change to non-existing directory.</p>
<pre><code class="language-sh">cd /app/data/data/appdata_${instanceId}/preview/
</code></pre>
<p dir="auto">should be</p>
<pre><code class="language-sh">cd /app/data/appdata_${instanceId}/preview/
</code></pre>
]]></description><link>https://forum.cloudron.io/topic/16026/wrong-directory-for-previewcleanup-cron-job</link><generator>RSS for Node</generator><lastBuildDate>Fri, 02 Oct 2026 12:38:02 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/16026.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 28 Sep 2026 17:02:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Thu, 01 Oct 2026 21:45:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james" aria-label="Profile: james">@<bdi>james</bdi></a> I haven't used it too much today, but noone else complained either, so I think it's working fine at the moment. I'm not sure if creating the folder was the only thing that was needed, I also killed the cleanup process once and restarted a few times, but most likely the mkdir and chown brought it back</p>
]]></description><link>https://forum.cloudron.io/post/130337</link><guid isPermaLink="true">https://forum.cloudron.io/post/130337</guid><dc:creator><![CDATA[msbt]]></dc:creator><pubDate>Thu, 01 Oct 2026 21:45:46 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Thu, 01 Oct 2026 20:09:41 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/msbt" aria-label="Profile: msbt">@<bdi>msbt</bdi></a><br />
Checking in to confirm something.<br />
Is your Nextcloud currently working fine after you did created <code>/var/lib/nextcloud/preview</code> manually?</p>
]]></description><link>https://forum.cloudron.io/post/130329</link><guid isPermaLink="true">https://forum.cloudron.io/post/130329</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Thu, 01 Oct 2026 20:09:41 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Thu, 01 Oct 2026 09:54:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james" aria-label="Profile: james">@<bdi>james</bdi></a> that would have been my theory as well, because my data folder is a Hetzner Storagebox mounted via sshfs. If it's outside of <a href="http://start.sh" target="_blank" rel="noopener noreferrer nofollow ugc">start.sh</a> it shouldn't be a problem, because the instance would start successfully and can then do the things needed. Appreciate the efforts!</p>
]]></description><link>https://forum.cloudron.io/post/130294</link><guid isPermaLink="true">https://forum.cloudron.io/post/130294</guid><dc:creator><![CDATA[msbt]]></dc:creator><pubDate>Thu, 01 Oct 2026 09:54:36 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Thu, 01 Oct 2026 09:40:20 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/msbt" aria-label="Profile: msbt">@<bdi>msbt</bdi></a></p>
<p dir="auto">Is your Nextcloud on an HDD or maybe a mounted network volume (NFS, CIFS)?<br />
It could be that because of a slow disk this really did take this long.</p>
<p dir="auto">I did some measurements, inspected Nextcloud code, and issues.<br />
There are many issues on GitHub complaining about image previews <a href="https://github.com/nextcloud/server/issues?q=is%3Aissue+state%3Aopen+preview+empty+folders" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/nextcloud/server/issues?q=is%3Aissue+state%3Aopen+preview+empty+folders</a></p>
<p dir="auto">By default, Nextcloud creates 4x image previews for each image.<br />
At an assumed 3-5 MB per photo, 300 GB is roughly 60k-100k images. The file size is an assumption.<br />
That means roughly 240k-400k preview rows and files, and about 55-95 GB of previews.</p>
<p dir="auto">Rows? Yes, Nextcloud stores each preview file in the <code>oc_previews</code> PostgreSQL table.<br />
And the command that we currently use in the <code>start.sh</code> is <code>$occ preview:cleanup</code>.<br />
This command goes through every preview image synchronously, one by one, deletes the file and then the row in <code>oc_previews</code>.</p>
<p dir="auto">Then there is another issue that empty preview folders are never cleaned up by Nextcloud.<br />
We already did implement the cron that this topic is about that cleans up these empty folders.<br />
Also, multiple GitHub issues dating back to 2024 and still this was never fixed upstream.</p>
<p dir="auto">That <code>$occ preview:cleanup</code> is working synchronously is in my opinion extremely inefficient.<br />
The command is for deleting all preview images, so why do it one by one?<br />
If the command is for deleting all, why not simply delete all at once and truncate the <code>oc_previews</code> table?<br />
I don't know why they don't do it that way.</p>
<p dir="auto">I will create an update for the Nextcloud app that moves this process outside the <code>start.sh</code> so the Nextcloud can start and that clean-up will be done in the background and if my idea of delete all at once and truncate the <code>oc_previews</code> is faster and does not cause issues will use that instead of the slow <code>$occ preview:cleanup</code>.</p>
]]></description><link>https://forum.cloudron.io/post/130292</link><guid isPermaLink="true">https://forum.cloudron.io/post/130292</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Thu, 01 Oct 2026 09:40:20 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Thu, 01 Oct 2026 07:59:03 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/msbt" aria-label="Profile: msbt">@<bdi>msbt</bdi></a><br />
Thanks for the report, I will see if I can replicate that issue.</p>
]]></description><link>https://forum.cloudron.io/post/130282</link><guid isPermaLink="true">https://forum.cloudron.io/post/130282</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Thu, 01 Oct 2026 07:59:03 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Thu, 01 Oct 2026 05:38:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james" aria-label="Profile: james">@<bdi>james</bdi></a> that update took down one of my Nextcloud instances. It was offline for 6 hours, stuck at <code>==&gt; Resetting previews</code>. There are maybe 300GB of images on that instance and it never managed to finish the cleanup (I think), only after I manually created <code>/var/lib/nextcloud/preview</code> it would come back up again. Not sure if the cleanup script was done that very minute or if there was an issue regarding that directory.</p>
]]></description><link>https://forum.cloudron.io/post/130280</link><guid isPermaLink="true">https://forum.cloudron.io/post/130280</guid><dc:creator><![CDATA[msbt]]></dc:creator><pubDate>Thu, 01 Oct 2026 05:38:08 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Tue, 29 Sep 2026 17:37:25 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/tobiasb" aria-label="Profile: tobiasb">@<bdi>tobiasb</bdi></a> and <a class="plugin-mentions-user plugin-mentions-a" href="/user/avatar1024" aria-label="Profile: avatar1024">@<bdi>avatar1024</bdi></a><br />
A Nextcloud update will we available tomorrow morning that fixes the issue and moves the image previews out of <code>/app/data/</code></p>
]]></description><link>https://forum.cloudron.io/post/130193</link><guid isPermaLink="true">https://forum.cloudron.io/post/130193</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Tue, 29 Sep 2026 17:37:25 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Tue, 29 Sep 2026 07:43:59 GMT]]></title><description><![CDATA[<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/james" aria-label="Profile: james">@<bdi>james</bdi></a> <a href="/post/130143">said</a>:</p>
<p dir="auto">In addition to this, I also think that preview images should not really be in <code>/app/data/</code>.<br />
They are not really worth being included in the backup since they can be regenerated at any time.<br />
With the new Cloudron versions there is now <a href="https://docs.cloudron.io/packaging/manifest#persistentdirs" target="_blank" rel="noopener noreferrer nofollow ugc">persistentDirs</a> so we should move them outside of <code>/app/data/</code>.</p>
</blockquote>
<p dir="auto">Yes please! NC previews can be a nightmare with rsync backups because it adds so many small files.</p>
]]></description><link>https://forum.cloudron.io/post/130162</link><guid isPermaLink="true">https://forum.cloudron.io/post/130162</guid><dc:creator><![CDATA[avatar1024]]></dc:creator><pubDate>Tue, 29 Sep 2026 07:43:59 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Mon, 28 Sep 2026 20:25:09 GMT]]></title><description><![CDATA[<p dir="auto">Oh I see, that new installation get /app/data/data. So the script is only buggy for the old installation. But yes move the previews out of backups.</p>
]]></description><link>https://forum.cloudron.io/post/130148</link><guid isPermaLink="true">https://forum.cloudron.io/post/130148</guid><dc:creator><![CDATA[tobiasb]]></dc:creator><pubDate>Mon, 28 Sep 2026 20:25:09 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Mon, 28 Sep 2026 19:40:04 GMT]]></title><description><![CDATA[<p dir="auto">MR: <a href="https://git.cloudron.io/packages/nextcloud-app/-/merge_requests/61/diffs" target="_blank" rel="noopener noreferrer nofollow ugc">https://git.cloudron.io/packages/nextcloud-app/-/merge_requests/61/diffs</a></p>
]]></description><link>https://forum.cloudron.io/post/130147</link><guid isPermaLink="true">https://forum.cloudron.io/post/130147</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Mon, 28 Sep 2026 19:40:04 GMT</pubDate></item><item><title><![CDATA[Reply to Wrong directory for previewcleanup cron job on Mon, 28 Sep 2026 18:24:10 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/tobiasb" aria-label="Profile: tobiasb">@<bdi>tobiasb</bdi></a><br />
Thanks for reporting.<br />
In addition to this, I also think that preview images should not really be in <code>/app/data/</code>.<br />
They are not really worth being included in the backup since they can be regenerated at any time.<br />
With the new Cloudron versions there is now <a href="https://docs.cloudron.io/packaging/manifest#persistentdirs" target="_blank" rel="noopener noreferrer nofollow ugc">persistentDirs</a> so we should move them outside of <code>/app/data/</code>.</p>
]]></description><link>https://forum.cloudron.io/post/130143</link><guid isPermaLink="true">https://forum.cloudron.io/post/130143</guid><dc:creator><![CDATA[james]]></dc:creator><pubDate>Mon, 28 Sep 2026 18:24:10 GMT</pubDate></item></channel></rss>