{"id":2575,"date":"2019-11-29T19:46:52","date_gmt":"2019-11-29T18:46:52","guid":{"rendered":"https:\/\/www.nausicamedia.fr\/blog\/?p=2575"},"modified":"2019-11-29T19:49:38","modified_gmt":"2019-11-29T18:49:38","slug":"filecloud-depuis-la-ligne-de-commande","status":"publish","type":"post","link":"https:\/\/nausicamedia.fr\/blog\/filecloud-depuis-la-ligne-de-commande\/","title":{"rendered":"FileCloud depuis la ligne de commande"},"content":{"rendered":"\n<p class=\"has-drop-cap\">Un utilisateur avait utilis\u00e9 la sauvegarde de <a href=\"HTTPS:\/\/getFilecloud.com\">FileCloud<\/a> pour archiver des milliers de courriels\u2026 L&rsquo;utilisateur parti de l&rsquo;entreprise, je d\u00e9cidais de supprimer cette sauvegarde tout en gardant l&rsquo;utilisateur g\u00e9n\u00e9rique. Le probl\u00e8me ? L&rsquo;interface de FileCloud, m\u00eame en version 19, continue d&rsquo;\u00eatre longue \u00e0 supprimer des centaines, et m\u00eame ici des milliers de fichiers, quand elle ne d\u00e9cide pas de tourner dans le vide et de ne\u2026 rien faire. Nous utiliserons donc la ligne de commande pour acc\u00e9l\u00e9rer la suppression de ces milliers de courriels. Filecloud utilise la fameuse et performante base de donn\u00e9es Mongo. Le serveur FileCloud est ici h\u00e9berg\u00e9 dans une machine virtuelle Parallels. J&rsquo;ai volontairement laiss\u00e9 certaines lignes de commande afin que cela puisse \u00eatre compris et j&rsquo;ai m\u00eame fait des listes afin de montrer l&rsquo;int\u00e9rieur des dossiers. Enfin j&rsquo;ai \u00f4t\u00e9 des lignes de texte inint\u00e9ressantes et les plus avis\u00e9s d\u2019entre vous verront que je fais certaines commandes pour v\u00e9rifier s\u2019il n\u2019y a pas des transferts en cours susceptibles de corrompre un fichier.<\/p>\n\n\n\n<p>Inutile de pr\u00e9ciser que ces commandes sont \u00e0 utiliser avec une pr\u00e9caution infinie !<\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:~# cd \/var\/www\/html\/scratch<\/code><\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/scratch# ls<\/code><\/p>\n\n\n\n<p>autobackups\u00a0 logs\u00a0 tmp<\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/scratch# cd logs<\/code><\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/scratch\/logs# ll<\/code><\/p>\n\n\n\n<p>total 16972<\/p>\n\n\n\n<p>drwxr-xr-x 2 www-data www-data&nbsp; &nbsp; 4096 nov.&nbsp; 28 07:00 .\/<\/p>\n\n\n\n<p>drwxr-xr-x 5 www-data www-data&nbsp; &nbsp; 4096 nov.&nbsp; 18 08:20 ..\/<\/p>\n\n\n\n<p>-rw-r&#8211;r&#8211; 1 www-data www-data&nbsp; 106263 nov.&nbsp; 28 15:50 log_2019-11-28.txt<\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/scratch\/logs# tail -f log_2019-11-28.txt\u00a0<\/code><\/p>\n\n\n\n<p>\/var\/www\/html\/core\/index.php(31): core\\framework\\TonidoCloudServer->execute()<\/p>\n\n\n\n<p>\/var\/www\/html\/core\/framework\/storagepathengine.class.php(1872): core\\framework\\StorageWrapper->getFileList(&lsquo;\/theuser\/recyc\u2026&rsquo;, NULL, NULL, Array)<\/p>\n\n\n\n<p>\/var\/www\/html\/core\/framework\/filemanager.class.php(484): core\\framework\\StoragePathEngine->getFileList(&lsquo;\/theuser\/recyc\u2026&rsquo;, \u00a0\u00bb, \u00a0\u00bb, &rsquo;10&rsquo;, &lsquo;0&rsquo;, &lsquo;theuser&rsquo;, &lsquo;name&rsquo;, 1, true, \u00a0\u00bb)<\/p>\n\n\n\n<p><code>^C<\/code><\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/scratch\/logs# mongo<\/code><\/p>\n\n\n\n<p>MongoDB shell version v3.6.14<\/p>\n\n\n\n<p>connecting to: mongodb:\/\/127.0.0.1:27017\/?gssapiServiceName=mongodb<\/p>\n\n\n\n<p>Implicit session: session { \u00ab\u00a0id\u00a0\u00bb : UUID(\u00ab\u00a06ae59758-9082-4d66-aba3-f2fc75471a31\u00a0\u00bb) }<\/p>\n\n\n\n<p>MongoDB server version: 3.6.14<\/p>\n\n\n\n<p><code>show dbs<\/code><\/p>\n\n\n\n<p>admin &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.000GB<\/p>\n\n\n\n<p>config&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.000GB<\/p>\n\n\n\n<p>fcbackup&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.009GB<\/p>\n\n\n\n<p>local &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0.000GB<\/p>\n\n\n\n<p><code>use tonidoclouddb<\/code><\/p>\n\n\n\n<p>switched to db tonidoclouddb<\/p>\n\n\n\n<p><code>show collections<\/code><\/p>\n\n\n\n<p>accesstokens<\/p>\n\n\n\n<p>acls<\/p>\n\n\n\n<p>activity<\/p>\n\n\n\n<p>background_queue<\/p>\n\n\n\n<p>background_queue_parallel<\/p>\n\n\n\n<p>backuprecords\u2026<\/p>\n\n\n\n<p><code>db.background_queue.count()<\/code><\/p>\n\n\n\n<p>0<\/p>\n\n\n\n<p><code>db.background_queue_parallel.count()<\/code><\/p>\n\n\n\n<p>0<\/p>\n\n\n\n<p><code>exit<\/code><\/p>\n\n\n\n<p>bye<\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/scratch\/logs# cd ..\/..\/<\/code><\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html# cd resources\/tools\/fileutils\/<\/code><\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/resources\/tools\/fileutils# ls<\/code><\/p>\n\n\n\n<p>bulkopdatastore.class.php&nbsp; emptyrecyclebin.php&nbsp; exportfs.php&nbsp; logger.class.php&nbsp; rmutil.php&nbsp; txfilesanddeleteaccount.php<\/p>\n\n\n\n<p><code>root@parallels-Parallels-Virtual-Platform:\/var\/www\/html\/resources\/tools\/fileutils# php rmutil.php -h default -u\u00a0theuser -p \/theuser\/recyclebin\/ -r<\/code><\/p>\n\n\n\n<p>Looking at host: default<\/p>\n\n\n\n<p>Delete<\/p>\n\n\n\n<p>Deleting directory \/theuser\/recyclebin\/\/backups -&gt; \/thesuer\/recyclebin\/\/backups<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Un utilisateur avait utilis\u00e9 la sauvegarde de FileCloud pour archiver des milliers de courriels\u2026 L&rsquo;utilisateur parti de l&rsquo;entreprise, je d\u00e9cidais de supprimer cette sauvegarde tout en gardant l&rsquo;utilisateur g\u00e9n\u00e9rique. Le probl\u00e8me ? L&rsquo;interface de FileCloud, m\u00eame en version 19, continue d&rsquo;\u00eatre longue \u00e0 supprimer des centaines, et m\u00eame ici des milliers de fichiers, quand elle [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[22,30],"class_list":["post-2575","post","type-post","status-publish","format-standard","hentry","category-active-storage-et-objectmatrix","tag-cli","tag-filecloud"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/posts\/2575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/comments?post=2575"}],"version-history":[{"count":0,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/posts\/2575\/revisions"}],"wp:attachment":[{"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/media?parent=2575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/categories?post=2575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nausicamedia.fr\/blog\/wp-json\/wp\/v2\/tags?post=2575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}