{"id":381165,"date":"2024-06-29T03:31:04","date_gmt":"2024-06-29T03:31:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=381165"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=381165","title":{"rendered":"<span>\u0420\u0435\u0446\u0435\u043f\u0442\u044b PostgreSQL: \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0420\u0435\u0435\u0441\u0442\u0440\u0430<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u0432 PostgreSQL \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0430\u043c <a href=\"https:\/\/www.postgresql.org\/\" rel=\"noopener noreferrer nofollow\">PostgreSQL<\/a>, bash, sh, curl, wget, <a href=\"https:\/\/github.com\/ddboline\/xml2\" rel=\"noopener noreferrer nofollow\">xml2csv<\/a>, <a href=\"https:\/\/stedolan.github.io\/jq\/\" rel=\"noopener noreferrer nofollow\">jq<\/a>, \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/pkgs\/container\/gar.docker\" rel=\"noopener noreferrer nofollow\">\u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>.<\/p>\n<p>\u041e\u0421\u0422\u041e\u0420\u041e\u0416\u041d\u041e! \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430! \u0422\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0445\u0432\u0430\u0442\u0438\u0442\u044c, \u043c\u043e\u0436\u0435\u0442, \u0434\u0430\u0436\u0435 \u043f\u043e\u043b-\u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u0430 \u0445\u0432\u0430\u0442\u0438\u0442.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b\u044b<\/p>\n<pre><code class=\"bash\"># \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 # \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f - \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 set -eux  SELF=\"$$\" # \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0441\u0432\u043e\u0439 pid touch deltaVersionId.txt # \u0434\u0430\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0434\u0435\u043b\u044c\u0442\u044b touch fullVersionId.txt # \u0434\u0430\u0442\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0413\u0410\u0420\u0430 touch state.txt # \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443<\/p>\n<pre><code class=\"bash\">state=\"$(cat state.txt)\" # \u0447\u0438\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 while # \u043f\u043e\u043a\u0430     case \"$state\" in # \u043f\u0440\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438         ... # \u0442\u0430\u043a\u043e\u043c-\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e-\u0442\u043e     esac     state=\"$(cat state.txt)\" # \u0447\u0438\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435     test \"$state\" != \"done\" # \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u043e do true; done 2>&amp;1 | tee cron.log # \u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433 \u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u044c<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u043e)<\/p>\n<pre><code class=\"bash\">* ) # \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 echo \"done\" >state.txt # \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e deltaVersionId=\"$(cat deltaVersionId.txt)\" # \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u0442\u0443 \u0434\u0435\u043b\u044c\u0442\u044b fullVersionId=\"$(cat fullVersionId.txt)\" # \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u0442\u0443 \u043f\u043e\u043b\u043d\u043e\u0433\u043e if [ -z \"$fullVersionId\" ]; then # \u0435\u0441\u043b\u0438 \u0435\u0449\u0451 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0438 \u043f\u043e\u043b\u043d\u044b\u0439     echo sql2pg >state.txt # \u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043c\u0438 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b elif [ -z \"$deltaVersionId\" ]; then # \u0438\u043d\u0430\u0447\u0435 \u0435\u0441\u043b\u0438 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0438 \u0434\u0435\u043b\u044c\u0442\u0443, \u0442\u043e # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430\u0445     wget --output-document=GetLastDownloadFileInfo.json https:\/\/fias.nalog.ru\/WebServices\/Public\/GetLastDownloadFileInfo  # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0438\u0437 \u043d\u0435\u0451 \u0434\u0430\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438        lastVersionId=\"$(jq --raw-output .VersionId &lt;GetLastDownloadFileInfo.json)\" # \u0438 \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438         URL=\"$(jq --raw-output .GarXMLFullURL &lt;GetLastDownloadFileInfo.json)\"     # \u0437\u0430\u0434\u0430\u0451\u043c \u0438\u043c\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430     ZIP=\"$lastVersionId.zip\"     # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0443 (\u043f\u043e\u043b\u043d\u0430\u044f \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u041e\u0427\u0415\u041d\u042c \u0434\u043e\u043b\u0433\u043e, \u0447\u0430\u0441\u043e\u0432 5)     wget --continue --output-document=\"$ZIP\" \"$URL\"     echo \"$lastVersionId\" >deltaVersionId.txt # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u0430\u043a \u0434\u0435\u043b\u044c\u0442\u044b     echo \"$lastVersionId\" >fullVersionId.txt # \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u043d\u043e\u0439     echo unzip >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 else # \u0438\u043d\u0430\u0447\u0435 (\u0431\u0430\u0437\u0430 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0443\u0436\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043b\u0438 \u043f\u043e\u043b\u043d\u0443\u044e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0443 \u0438\u043b\u0438 \u0434\u0435\u043b\u044c\u0442\u0443) # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430\u0445     wget --output-document=GetAllDownloadFileInfo.json https:\/\/fias.nalog.ru\/WebServices\/Public\/GetAllDownloadFileInfo # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0434\u0430\u0442\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u0435\u043b\u044c\u0442\u044b         jq --raw-output \"sort_by(.VersionId) | .[] | select(.VersionId > $deltaVersionId) \\     # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (\u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432)     | .GarXMLDeltaURL\" &lt;GetAllDownloadFileInfo.json | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=URL bash \/usr\/local\/bin\/wget.sh \"URL\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435     # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0430\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u0435\u043b\u044c\u0442\u044b     jq --raw-output \"sort_by(.VersionId) | .[] | select(.VersionId > $deltaVersionId) \\     # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438)     | .GarXMLDeltaURL\" &lt;GetAllDownloadFileInfo.json | xargs --verbose --no-run-if-empty --replace=URL bash \/usr\/local\/bin\/version.sh \"URL\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 fi ;;<\/code><\/pre>\n<p>\u0444\u0430\u0439\u043b\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043b\u044c\u0442\u044b \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442, \u043a\u0440\u043e\u043c\u0435 \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f<\/p>\n<pre><code class=\"bash\"># \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 SIZE=\"$(curl -Is \"$URL\" | grep 'Content-Length' | grep -oP '\\d+')\" test \"$SIZE\" -lt 1073741824 # \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u043e\u043b\u044c\u0448\u0435 1\u0413\u0411, \u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u043c<\/code><\/pre>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"sql2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b # \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u0435 sql-\u0441\u043a\u0440\u0438\u043f\u0442\u044b find \/usr\/local\/sql2pg -type f -name \"*.sql\" | sort -u \\ # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e | xargs --verbose --no-run-if-empty --replace=SQL cat \"SQL\" | psql --variable=ON_ERROR_STOP=1 test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 echo region2pg >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432 ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/sql2pg\" rel=\"noopener noreferrer nofollow\">sql-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432<\/p>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"region2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432 # \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043e\u0442 01 \u0434\u043e 99 (\u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0437\u044f\u0442 \u0432\u0435\u0441\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0447\u0438\u0441\u0435\u043b) seq --format \"%02.0f\" 1 99 \\ # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0432 \u0431\u0430\u0437\u0443 | xargs --verbose --no-run-if-empty --replace=REGION echo \"CREATE SCHEMA IF NOT EXISTS \\\"REGION\\\";\" | psql --variable=ON_ERROR_STOP=1 test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/region2pg -type f -name \"*.sh\" | sort -u | while read -r SH; do     seq --format \"%02.0f\" 1 99 \\ # \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430     # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 sql-\u043a\u043e\u0434         # \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432     | xargs --verbose --no-run-if-empty --replace=REGION sh \"$SH\" \"REGION\" | psql --variable=ON_ERROR_STOP=1     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 done echo wget >fullVersionId.txt # \u0437\u0430\u043d\u0443\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e echo wget >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f # \u043d\u043e \u0442.\u043a. \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0435\u0442, \u0442\u043e \u043e\u043d\u043e # \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 \u0441\u0430\u043c\u044b\u043c \u043f\u0435\u0440\u0432\u044b\u043c ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/region2pg\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e sql-\u043a\u043e\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430<\/p>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"unzip\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 find . -type f -name \"*.zip\" | sort -u \\ # \u0432\u0441\u0435 \u0430\u0440\u0445\u0438\u0432\u044b # \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e      # (\u0434\u0435\u043b\u0430\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438)     # \u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u044f \u0430\u0440\u0445\u0438\u0432 | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=ZIP bash \/usr\/local\/bin\/unzip.sh \"ZIP\" test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 echo xml2csv >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 ;;<\/code><\/pre>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"xml2csv\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/xml2csv -type f -name \"*.sh\" | sort -u | while read -r SH; do     TABLE=\"$(basename -- \"${SH%.*}\")\" # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 xml-\u0444\u0430\u0439\u043b\u043e\u0432     find . -type f -name \"as_${TABLE}_2*.xml\" | sort -u \\     # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432 csv-\u0444\u0430\u0439\u043b\u044b         # \u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c xml-\u0444\u0430\u0439\u043b     | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=XML bash \"$SH\" \"XML\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 done deltaVersionId=\"$(cat deltaVersionId.txt)\" # \u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443 \u0434\u0435\u043b\u044c\u0442\u044b fullVersionId=\"$(cat fullVersionId.txt)\" # \u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 # \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 if [ \"$deltaVersionId\" != \"$fullVersionId\" ]; then     echo delta2pg >state.txt # \u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0435\u043b\u044c\u0442\u044b else # \u0438\u043d\u0430\u0447\u0435 (\u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435)     echo full2pg >state.txt # \u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0439 fi ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/xml2csv\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438<\/p>\n<p>\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442<\/p>\n<pre><code class=\"bash\">\"full2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/full2pg -type f -name \"*.sh\" | sort -u | while read -r SH; do     TABLE=\"$(basename -- \"${SH%.*}\")\" # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 csv-\u0444\u0430\u0439\u043b\u043e\u0432     find . -type f -name \"as_${TABLE}_2*.csv\" | sort -u \\     # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0445 \u0432 \u0431\u0430\u0437\u0443         # \u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c csv-\u0444\u0430\u0439\u043b     | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=CSV bash \"$SH\" \"CSV\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 done echo update >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/full2pg\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e sql-\u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 COPY \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<p>\u0438\u043b\u0438 \u0436\u0435 (\u0432\u043e \u0432\u0441\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u044b) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442<\/p>\n<pre><code class=\"bash\">\"delta2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0435\u043b\u044c\u0442\u044b # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/delta2pg -type f -name \"*.sh\" | sort -u | while read -r SH; do     TABLE=\"$(basename -- \"${SH%.*}\")\" # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u043b\u044c\u0442 (\u0435\u0441\u043b\u0438 \u0438\u0445 \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0430)     find -mindepth 1 -maxdepth 1 -type d | sort -u | while read -r DIR; do     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 csv-\u0444\u0430\u0439\u043b\u043e\u0432         find \"$DIR\" -type f -name \"as_${TABLE}_2*.csv\" | sort -u \\         # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0445 \u0432 \u0431\u0430\u0437\u0443             # \u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c csv-\u0444\u0430\u0439\u043b         | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=CSV bash \"$SH\" \"CSV\"         test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435         rmdir \"$DIR\"\/* \"$DIR\" # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u0435\u043b\u044c\u0442\u044b     done done echo update >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/delta2pg\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e sql-\u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 COPY \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043a\u043e\u0444\u043b\u0438\u043a\u0442\u0435, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/p>\n<p>\u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0434\u043e\u043a\u0435\u0440\u0435 \u043f\u043e \u043a\u0440\u043e\u043d\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u0432 PostgreSQL<\/p>\n<p>\u041f\u0440\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/584724\/\"> https:\/\/habr.com\/ru\/articles\/584724\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u0414\u043b\u044f \u043f\u0440\u0438\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u0432 PostgreSQL \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0441\u0430\u043c <a href=\"https:\/\/www.postgresql.org\/\" rel=\"noopener noreferrer nofollow\">PostgreSQL<\/a>, bash, sh, curl, wget, <a href=\"https:\/\/github.com\/ddboline\/xml2\" rel=\"noopener noreferrer nofollow\">xml2csv<\/a>, <a href=\"https:\/\/stedolan.github.io\/jq\/\" rel=\"noopener noreferrer nofollow\">jq<\/a>, \u0438\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f <a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/pkgs\/container\/gar.docker\" rel=\"noopener noreferrer nofollow\">\u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c<\/a>.<\/p>\n<p>\u041e\u0421\u0422\u041e\u0420\u041e\u0416\u041d\u041e! \u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430! \u0422\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u043e \u0445\u0432\u0430\u0442\u0438\u0442\u044c, \u043c\u043e\u0436\u0435\u0442, \u0434\u0430\u0436\u0435 \u043f\u043e\u043b-\u0442\u0435\u0440\u0430\u0431\u0430\u0439\u0442\u0430 \u0445\u0432\u0430\u0442\u0438\u0442.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b\u044b<\/p>\n<pre><code class=\"bash\"># \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 # \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f - \u044d\u0442\u043e \u043e\u0448\u0438\u0431\u043a\u0430 set -eux  SELF=\"$$\" # \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c \u0441\u0432\u043e\u0439 pid touch deltaVersionId.txt # \u0434\u0430\u0442\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0439 \u0434\u0435\u043b\u044c\u0442\u044b touch fullVersionId.txt # \u0434\u0430\u0442\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0433\u043e \u0413\u0410\u0420\u0430 touch state.txt # \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435<\/code><\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443<\/p>\n<pre><code class=\"bash\">state=\"$(cat state.txt)\" # \u0447\u0438\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 while # \u043f\u043e\u043a\u0430     case \"$state\" in # \u043f\u0440\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438         ... # \u0442\u0430\u043a\u043e\u043c-\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e-\u0442\u043e     esac     state=\"$(cat state.txt)\" # \u0447\u0438\u0442\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0435\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435     test \"$state\" != \"done\" # \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u043e\u043a\u0430 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043d\u0435 \u0433\u043e\u0442\u043e\u0432\u043e do true; done 2>&amp;1 | tee cron.log # \u043f\u0438\u0448\u0435\u043c \u0432 \u043b\u043e\u0433 \u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u044c<\/code><\/pre>\n<p>\u0418\u0442\u0430\u043a, \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f (\u0430 \u0442\u0430\u043a\u0436\u0435 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0433\u043e\u0442\u043e\u0432\u043e)<\/p>\n<pre><code class=\"bash\">* ) # \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 echo \"done\" >state.txt # \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0433\u043e\u0442\u043e\u0432\u043e deltaVersionId=\"$(cat deltaVersionId.txt)\" # \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u0442\u0443 \u0434\u0435\u043b\u044c\u0442\u044b fullVersionId=\"$(cat fullVersionId.txt)\" # \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u043c \u0434\u0430\u0442\u0443 \u043f\u043e\u043b\u043d\u043e\u0433\u043e if [ -z \"$fullVersionId\" ]; then # \u0435\u0441\u043b\u0438 \u0435\u0449\u0451 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0438 \u043f\u043e\u043b\u043d\u044b\u0439     echo sql2pg >state.txt # \u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043c\u0438 \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b elif [ -z \"$deltaVersionId\" ]; then # \u0438\u043d\u0430\u0447\u0435 \u0435\u0441\u043b\u0438 \u043d\u0438 \u0440\u0430\u0437\u0443 \u043d\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u043b\u0438 \u0434\u0435\u043b\u044c\u0442\u0443, \u0442\u043e # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430\u0445     wget --output-document=GetLastDownloadFileInfo.json https:\/\/fias.nalog.ru\/WebServices\/Public\/GetLastDownloadFileInfo  # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u0438\u0437 \u043d\u0435\u0451 \u0434\u0430\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438        lastVersionId=\"$(jq --raw-output .VersionId &lt;GetLastDownloadFileInfo.json)\" # \u0438 \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438         URL=\"$(jq --raw-output .GarXMLFullURL &lt;GetLastDownloadFileInfo.json)\"     # \u0437\u0430\u0434\u0430\u0451\u043c \u0438\u043c\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430     ZIP=\"$lastVersionId.zip\"     # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0443 (\u043f\u043e\u043b\u043d\u0430\u044f \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u041e\u0427\u0415\u041d\u042c \u0434\u043e\u043b\u0433\u043e, \u0447\u0430\u0441\u043e\u0432 5)     wget --continue --output-document=\"$ZIP\" \"$URL\"     echo \"$lastVersionId\" >deltaVersionId.txt # \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0434\u0430\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043a\u0430\u043a \u0434\u0435\u043b\u044c\u0442\u044b     echo \"$lastVersionId\" >fullVersionId.txt # \u0442\u0430\u043a \u0438 \u043f\u043e\u043b\u043d\u043e\u0439     echo unzip >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 else # \u0438\u043d\u0430\u0447\u0435 (\u0431\u0430\u0437\u0430 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0438 \u0443\u0436\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043b\u0438 \u043f\u043e\u043b\u043d\u0443\u044e \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0443 \u0438\u043b\u0438 \u0434\u0435\u043b\u044c\u0442\u0443) # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431\u043e \u0432\u0441\u0435\u0445 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0430\u0445     wget --output-document=GetAllDownloadFileInfo.json https:\/\/fias.nalog.ru\/WebServices\/Public\/GetAllDownloadFileInfo # \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u0441\u043b\u0435 \u0434\u0430\u0442\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u0435\u043b\u044c\u0442\u044b         jq --raw-output \"sort_by(.VersionId) | .[] | select(.VersionId > $deltaVersionId) \\     # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u043e\u043a\u043e\u0432 (\u043f\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432)     | .GarXMLDeltaURL\" &lt;GetAllDownloadFileInfo.json | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=URL bash \/usr\/local\/bin\/wget.sh \"URL\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435     # \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u0430\u0442\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0434\u0435\u043b\u044c\u0442\u044b     jq --raw-output \"sort_by(.VersionId) | .[] | select(.VersionId > $deltaVersionId) \\     # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e (\u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438)     | .GarXMLDeltaURL\" &lt;GetAllDownloadFileInfo.json | xargs --verbose --no-run-if-empty --replace=URL bash \/usr\/local\/bin\/version.sh \"URL\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 fi ;;<\/code><\/pre>\n<p>\u0444\u0430\u0439\u043b\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0434\u0435\u043b\u044c\u0442\u044b \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0435\u0431\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442, \u043a\u0440\u043e\u043c\u0435 \u0440\u0430\u0437\u0432\u0435 \u0447\u0442\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f<\/p>\n<pre><code class=\"bash\"># \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430 SIZE=\"$(curl -Is \"$URL\" | grep 'Content-Length' | grep -oP '\\d+')\" test \"$SIZE\" -lt 1073741824 # \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u043e\u043b\u044c\u0448\u0435 1\u0413\u0411, \u0442\u043e \u0432\u044b\u0445\u043e\u0434\u0438\u043c<\/code><\/pre>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"sql2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b # \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u0435 sql-\u0441\u043a\u0440\u0438\u043f\u0442\u044b find \/usr\/local\/sql2pg -type f -name \"*.sql\" | sort -u \\ # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e | xargs --verbose --no-run-if-empty --replace=SQL cat \"SQL\" | psql --variable=ON_ERROR_STOP=1 test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 echo region2pg >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432 ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/sql2pg\" rel=\"noopener noreferrer nofollow\">sql-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446 \u0441 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c\u0438 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432<\/p>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"region2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0430\u0437\u044b \u0434\u043b\u044f \u0440\u0435\u0433\u0438\u043e\u043d\u043e\u0432 # \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430 \u043e\u0442 01 \u0434\u043e 99 (\u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0432\u0437\u044f\u0442 \u0432\u0435\u0441\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0447\u0438\u0441\u0435\u043b) seq --format \"%02.0f\" 1 99 \\ # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0441\u0445\u0435\u043c\u0443 \u0432 \u0431\u0430\u0437\u0443 | xargs --verbose --no-run-if-empty --replace=REGION echo \"CREATE SCHEMA IF NOT EXISTS \\\"REGION\\\";\" | psql --variable=ON_ERROR_STOP=1 test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/region2pg -type f -name \"*.sh\" | sort -u | while read -r SH; do     seq --format \"%02.0f\" 1 99 \\ # \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430     # \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 sql-\u043a\u043e\u0434         # \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432     | xargs --verbose --no-run-if-empty --replace=REGION sh \"$SH\" \"REGION\" | psql --variable=ON_ERROR_STOP=1     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 done echo wget >fullVersionId.txt # \u0437\u0430\u043d\u0443\u043b\u044f\u0435\u043c \u043f\u043e\u043b\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e echo wget >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f # \u043d\u043e \u0442.\u043a. \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0435\u0442, \u0442\u043e \u043e\u043d\u043e # \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u043c, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u043c \u0432\u044b\u0448\u0435 \u0441\u0430\u043c\u044b\u043c \u043f\u0435\u0440\u0432\u044b\u043c ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/region2pg\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e sql-\u043a\u043e\u0434\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430<\/p>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"unzip\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u043a\u0438 find . -type f -name \"*.zip\" | sort -u \\ # \u0432\u0441\u0435 \u0430\u0440\u0445\u0438\u0432\u044b # \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e      # (\u0434\u0435\u043b\u0430\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u043e\u0432 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u043c\u0438 \u0431\u0443\u043a\u0432\u0430\u043c\u0438)     # \u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u044f \u0430\u0440\u0445\u0438\u0432 | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=ZIP bash \/usr\/local\/bin\/unzip.sh \"ZIP\" test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 echo xml2csv >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 ;;<\/code><\/pre>\n<p>\u0434\u0430\u043b\u0435\u0435<\/p>\n<pre><code class=\"bash\">\"xml2csv\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438 # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/xml2csv -type f -name \"*.sh\" | sort -u | while read -r SH; do     TABLE=\"$(basename -- \"${SH%.*}\")\" # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 xml-\u0444\u0430\u0439\u043b\u043e\u0432     find . -type f -name \"as_${TABLE}_2*.xml\" | sort -u \\     # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438\u0445 \u0432 csv-\u0444\u0430\u0439\u043b\u044b         # \u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c xml-\u0444\u0430\u0439\u043b     | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=XML bash \"$SH\" \"XML\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 done deltaVersionId=\"$(cat deltaVersionId.txt)\" # \u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0451\u043d\u043d\u0443\u044e \u0434\u0430\u0442\u0443 \u0434\u0435\u043b\u044c\u0442\u044b fullVersionId=\"$(cat fullVersionId.txt)\" # \u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 # \u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u0440\u0430\u0437\u043d\u044b\u0435 if [ \"$deltaVersionId\" != \"$fullVersionId\" ]; then     echo delta2pg >state.txt # \u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0435\u043b\u044c\u0442\u044b else # \u0438\u043d\u0430\u0447\u0435 (\u0435\u0441\u043b\u0438 \u043e\u043d\u0438 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435)     echo full2pg >state.txt # \u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0439 fi ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/xml2csv\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0434\u043b\u044f \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0430\u0446\u0438\u0438<\/p>\n<p>\u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442<\/p>\n<pre><code class=\"bash\">\"full2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e\u043b\u043d\u043e\u0439 \u0432\u044b\u0433\u0440\u0443\u0437\u043a\u0438 # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/full2pg -type f -name \"*.sh\" | sort -u | while read -r SH; do     TABLE=\"$(basename -- \"${SH%.*}\")\" # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 csv-\u0444\u0430\u0439\u043b\u043e\u0432     find . -type f -name \"as_${TABLE}_2*.csv\" | sort -u \\     # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0445 \u0432 \u0431\u0430\u0437\u0443         # \u0438 \u043f\u0440\u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c csv-\u0444\u0430\u0439\u043b     | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=CSV bash \"$SH\" \"CSV\"     test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435 done echo update >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/full2pg\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e sql-\u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 COPY \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<p>\u0438\u043b\u0438 \u0436\u0435 (\u0432\u043e \u0432\u0441\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u044b) \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442<\/p>\n<pre><code class=\"bash\">\"delta2pg\" ) # \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0435\u043b\u044c\u0442\u044b # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 sh-\u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 find \/usr\/local\/delta2pg -type f -name \"*.sh\" | sort -u | while read -r SH; do     TABLE=\"$(basename -- \"${SH%.*}\")\" # \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0435\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u043a\u0430\u0447\u0430\u043d\u043d\u044b\u0445 \u0434\u0435\u043b\u044c\u0442 (\u0435\u0441\u043b\u0438 \u0438\u0445 \u0431\u044b\u043b\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0430)     find -mindepth 1 -maxdepth 1 -type d | sort -u | while read -r DIR; do     # \u0434\u043b\u044f \u0432\u0441\u0435\u0445 csv-\u0444\u0430\u0439\u043b\u043e\u0432         find \"$DIR\" -type f -name \"as_${TABLE}_2*.csv\" | sort -u \\         # \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0438\u0445 \u0432 \u0431\u0430\u0437\u0443             # \u0438 \u0443\u0441\u043f\u0435\u0445\u0435 \u0443\u0434\u0430\u043b\u044f\u0435\u043c csv-\u0444\u0430\u0439\u043b         | xargs --verbose --no-run-if-empty --max-procs=\"$(nproc)\" --replace=CSV bash \"$SH\" \"CSV\"         test $? -eq 0 || kill -SIGINT \"$SELF\" # \u0432\u044b\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435         rmdir \"$DIR\"\/* \"$DIR\" # \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u0435\u043b\u044c\u0442\u044b     done done echo update >state.txt # \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f ;;<\/code><\/pre>\n<p><a href=\"https:\/\/github.com\/RekGRpth\/gar.docker\/tree\/latest\/local\/delta2pg\" rel=\"noopener noreferrer nofollow\">sh-\u0441\u043a\u0440\u0438\u043f\u0442\u044b<\/a> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e sql-\u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 COPY \u0432\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0432\u0441\u0435\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043a\u0443 \u0438\u0437 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u0438 \u043a\u043e\u0444\u043b\u0438\u043a\u0442\u0435, \u0430 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043d\u0435\u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u0437 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/p>\n<p>\u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044f \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u0432 \u0434\u043e\u043a\u0435\u0440\u0435 \u043f\u043e \u043a\u0440\u043e\u043d\u0443 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u0432 PostgreSQL<\/p>\n<p>\u041f\u0440\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0413\u043e\u0441\u0443\u0434\u0430\u0440\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0410\u0434\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0420\u0435\u0435\u0441\u0442\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/584724\/\"> https:\/\/habr.com\/ru\/articles\/584724\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-381165","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/381165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=381165"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/381165\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=381165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=381165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=381165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}