{"id":631,"date":"2019-03-29T18:23:05","date_gmt":"2019-03-29T17:23:05","guid":{"rendered":"http:\/\/www.ume.li\/blog\/?p=631"},"modified":"2019-03-29T18:23:05","modified_gmt":"2019-03-29T17:23:05","slug":"connections-mass-file-removal","status":"publish","type":"post","link":"https:\/\/www.ume.li\/blog\/2019\/03\/29\/connections-mass-file-removal\/","title":{"rendered":"Connections &#8211; Mass file removal"},"content":{"rendered":"<p>I got a request to cleanup some files in a IBM Connections environment. Remove all the files created before 1.1.2015.<br \/>\nGetting the list of files is easy.<br \/>\n<code><br \/>\nconnect to files@<br \/>\nexport to files.csv of del modified by nochardel<br \/>\nselect hex(ID), id, title,create_date from files.media where create_date < date('2015-01-01')@\nconnect reset@\n<\/code><br \/>\nThis got me around 11'000 records.<br \/>\nIn the<a href=\"https:\/\/www-10.lotus.com\/ldd\/lcwiki.nsf\/xpAPIViewer.xsp?lookupName=IBM+Connections+6.0+API+Documentation#action=openDocument&#038;res_title=Deleting_a_file_and_its_metadata_ic60&#038;content=apicontent\" rel=\"noopener noreferrer\" target=\"_blank\"> api documentation<\/a> I found the required API call.<br \/>\nAfter a while I got my first node.js app. Which was correctly posting the required requests against my server. Doing a testrun with 11'000 records was a bad idea. My environment was so fast, that it sent the 11'000 requests in under 10s.<br \/>\nThe first couple of request passed, but then I got a lot of errors and the files app did not respond at all. With the help of <a href=\"https:\/\/www.npmjs.com\/package\/simple-rate-limiter\" rel=\"noopener noreferrer\" target=\"_blank\">simple rate limiter<\/a> I throttled it down to 2 requests\/per second. The process will now take a bit longer, but at least the connections environment stays alive.<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got a request to cleanup some files in a IBM Connections environment. Remove all the files created before 1.1.2015.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-631","post","type-post","status-publish","format-standard","hentry","category-connections"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/comments?post=631"}],"version-history":[{"count":2,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/631\/revisions"}],"predecessor-version":[{"id":633,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/posts\/631\/revisions\/633"}],"wp:attachment":[{"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/media?parent=631"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/categories?post=631"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ume.li\/blog\/wp-json\/wp\/v2\/tags?post=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}