Hi,
I do have huge image local storage
/var/discourse/shared/standalone/uploads/default
57.5GiB [##########] /original
35.6GiB [###### ] /optimized
the original
56.7GiB [##########] /3X
667.6MiB [ ] /2X
155.5MiB [ ] /1X
and optimized
33.8GiB [##########] /3X
1.7GiB [ ] /2X
113.3MiB [ ] /1X
I found this settings and make this 1 and 2. Is it relevant settings?

I would like to drop all 3X images (original and optimized) and store/show only 2X picture?
How to setup this configuration?
T H A N K S
sam
(Sam Saffron)
2
3x is just a naming convention it has nothing to do with image size
If you want to cut on storage you could run the rake task that irreversibly shrinks old images and drops fidelity
how to do it? what’s the command line?
sam
(Sam Saffron)
4
This script should do it:
But I would be very very careful to have a full backup of everything prior to playing with it.
/var/discourse/shared/standalone/uploads/default
57.5GiB [##########] /original
35.6GiB [###### ] /optimized
/original と /optimized のどちらのフォルダを削除すれば、ディスク容量を解放できますか?
@sam が言ったように、ディスク使用量を本当に減らしたいのであれば、すべてのオリジナル画像を縮小し、すべてのサムネイル(つまり「最適化」された画像)を再生成する必要があります。
ディスク上のファイルとデータベース内の関連レコードの両方を更新する必要があるため、このプロセスは複雑です。
しまった!
フォルダを移動している最中に、/original フォルダを壊してしまいました。
/optimized フォルダや Postgres DB から画像を使うことはできますか?
もう手遅れでしょうか?
sam
(Sam Saffron)
9
最適化から復元を試みることもできますが、品質は限定的になります
アップロードを含むバックアップがある場合、アーカイブから直接 originals ディレクトリに抽出できます。
その方法はどうすればよいですか?私の環境には /optimized フォルダが完全に存在しています。
私はアップロードを除いたコンテンツのみをバックアップしています。
単に /optimized を /original にコピーすべきでしょうか?
sam
(Sam Saffron)
14
以下をご覧ください:
./launcher enter app
rails c
Upload.last(10)
そこに URL が表示されています。アップロードが期待される場所です。
root@dastereo:/var/postgres_data_discourse# du -hs * | sort -rh | head -5
33G base
129M pg_wal
46M pg_xact
616K global
216K pg_subtrans
Postgres DB には画像も含まれていますか?問題ありませんか?
ファイルはすべてディスクに保存され、データベースは一部のメタデータのレコードのみを保持します。