更新 2.sh

This commit is contained in:
lqs 2025-03-12 13:27:04 +08:00
parent 1762838cd8
commit c0feccb177

12
2.sh
View File

@ -18,3 +18,15 @@ curl -F 'master_pwd=Sj89061189' \
-F 'copy=true' \ -F 'copy=true' \
-F 'name=SJFZ_2025_1' \ -F 'name=SJFZ_2025_1' \
http://localhost:2025/web/database/restore 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