From c22fc420b91d827b2f99ff23be34a2b45567c3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Gigandet?= Date: Thu, 19 Sep 2024 14:50:53 +0200 Subject: [PATCH] fix: new mongodb exports for obsolete products collection (#10794) add exports of obsolete products (requested by MyLabel app) Co-authored-by: Off --- scripts/mongodb_dump.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/mongodb_dump.sh b/scripts/mongodb_dump.sh index b758c62b75db6..fe206172f08b2 100755 --- a/scripts/mongodb_dump.sh +++ b/scripts/mongodb_dump.sh @@ -15,6 +15,8 @@ cd $DIR pushd data/ > /dev/null mongoexport --collection products --host $HOST --db $DB | gzip > new.$PREFIX-products.jsonl.gz && \ mv new.$PREFIX-products.jsonl.gz $PREFIX-products.jsonl.gz +mongoexport --collection products_obsolete --host $HOST --db $DB | gzip > new.$PREFIX-products_obsolete.jsonl.gz && \ +mv new.$PREFIX-products_obsolete.jsonl.gz $PREFIX-products_obsolete.jsonl.gz mongodump --collection products --host $HOST --db $DB --gzip --archive="new.${PREFIX}-mongodbdump.gz" && \ sha256sum new.$PREFIX-mongodbdump.gz |sed -e 's/new\.//' > new.gz-sha256sum && \ @@ -23,6 +25,13 @@ mv new.${PREFIX}-mongodbdump.gz ${PREFIX}-mongodbdump.gz && \ mv new.gz-sha256sum gz-sha256sum && \ mv new.gz-md5sum gz-md5sum +mongodump --collection products_obsolete --host $HOST --db $DB --gzip --archive="new.${PREFIX}_obsolete-mongodbdump.gz" && \ +sha256sum new.${PREFIX}_obsolete-mongodbdump.gz |sed -e 's/new\.//' > new.obsolete.gz-sha256sum && \ +md5sum new.${PREFIX}_obsolete-mongodbdump.gz |sed -e 's/new\.//' > new.obsolete.gz-md5sum && \ +mv new.${PREFIX}_obsolete-mongodbdump.gz ${PREFIX}_obsolete-mongodbdump.gz && \ +mv new.obsolete.gz-sha256sum obsolete.gz-sha256sum && \ +mv new.obsolete.gz-md5sum obsolete.gz-md5sum + # Export delta of products modified in the last 24h or since last run of the script mkdir -p delta pushd delta/ > /dev/null