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