From c0feccb17769cd9942d3a7c8d4002850a56e33d2 Mon Sep 17 00:00:00 2001 From: lqs <441785369@qq.com> Date: Wed, 12 Mar 2025 13:27:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=202.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 2.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/2.sh b/2.sh index 3a18372..e0a3fe1 100644 --- a/2.sh +++ b/2.sh @@ -17,4 +17,16 @@ curl -F 'master_pwd=Sj89061189' \ -F backup_file=@SJFZ_2025_1_2025-03-11_15-40-24.zip \ -F 'copy=true' \ -F 'name=SJFZ_2025_1' \ - http://localhost:2025/web/database/restore \ No newline at end of file + http://localhost:2025/web/database/restore + +sudo -u postgres psql -d SJFZ2023 << EOF +SELECT id, name, store_fname +FROM ir_attachment +WHERE store_fname NOT LIKE '/%' + AND NOT EXISTS ( + SELECT 1 + FROM pg_ls_dir('/var/lib/odoo/.local/share/Odoo/filestore/SJFZ2023/' || left(store_fname,2)) + AS files + WHERE files = right(store_fname, -3) + ); +EOF \ No newline at end of file