How to save space on the server by deleting automaticly documents in the trashes of a subdirectory ?

Hi,

Almost everything is in the title ;-) I've read questions ans answers about this problem of getting trashes emptied automaticly, but I didn't understand what I read. Knowing I don't use Studio, what is the way to empty theses trashes recursivly ?

Thx, and regards !

JB

0 votes

2 answers

1550 views

ANSWER



you can setup a scheduler that calls (event handler) an automation chain that will query for deleted documents and remove them.

It could be done through Nuxeo Shell too.

0 votes



Hi Thx for the answer. But i'm affraid i need more explanations since i hardly understand what you mean. What is a scheduler, How do i set up one, what is a automation chain ? JB Potokar iPhone

Le 27 avr. 2016 à 21:48, pibou Bouvret (Quandora) <notifications@quandora.com<mailto:notifications@quandora.com>> a écrit :

you can setup a scheduler that calls (event handler) an automation chain that will query for deleted documents and remove them.

It could be done through Nuxeo Shell too.

— don't write anything below this line —

pibou Bouvret<http://email.app.quandora.com/c/eJwVjsuKxCAQRb8m7iKllkYXLppA_4dVKplXzJiE6f77SeDCgbM4XI7U7bqIHLOpLD6iBuUA9aQCBq0kAmgnMTgdpLdPM8M8Dwhp2-TvmdbcepLcfsQSCxXjQrZAtVjDzIUmrhXBs6JUjfiOy3Fs-2Aeg35eS-v-V_ou1_NV2h253Llf5iJRAKu1GjMVP6Ka_OirraPNE2Li4hhA9PhJWzvaV-r3pZPS-878A1CEP3s> answered to your question How to save space on the server by deleting automaticly documents in the trashes of a subdirectory ? <http://email.app.quandora.com/c/eJxdjjsOgzAQBU-DO6z1-scWLiIk7rG2sQhJMCFQ5PaBNtKrZqTRSyFudplEDlmXJO4BQTkw6BUZQiUNADppyCHJzg66h75vDPC6yvfBS64by1RfYgreRl1sLkUR62KK7bIjYocePCQg8QzTvq-fRt8aHM79N05U4zym_XKdB1WcbbEwtUaNqo2sU-utR2NJj24EsYU5rnWvD96uS0fk79X5AYZEPWM> :

you can setup a scheduler that calls (event handler) an automation chain that will query for deleted documents and remove them.

It could be done through Nuxeo Shell too.

Question (3 views):

Hi,

Almost everything is in the title ;-) I've read questions ans answers about this problem of getting trashes emptied automaticly, but I didn't understand what I read. Knowing I don't use Studio, what is the way to empty theses trashes recursivly ?

Thx, and regards !

JB

Comment this Answer<http://email.app.quandora.com/c/eJxdjjsOgzAQBU-DO6z1-scWLiIk7rG2sQhJMCFQ5PaBNtKrZqTRSyFudplEDlmXJO4BQTkw6BUZQiUNADppyCHJzg66h75vDPC6yvfBS64by1RfYgreRl1sLkUR62KK7bIjYocePCQg8QzTvq-fRt8aHM79N05U4zym_XKdB1WcbbEwtUaNqo2sU-utR2NJj24EsYU5rnWvD96uS0fk79X5AYZEPWM> Vote Up this Answer<http://email.app.quandora.com/c/eJwVT8tuwzAM-5rkZkN-xwcfigD9D9mWl21dnDpJu_39HICCCIEgxRRiM-sy5pBVSeNnkCAsaOmE114KrgGk5dpb6flk7mqGeR404Lbx54lrrg15qj_jEiBDJkWYwfvsFepkPcEkJyEolljGR1iOY9sHdRvkvQPX_U1t5-v5S_Uy6bcPWqnho7Nnn6xjf8plhoYk0w6A-ZIUI61sSjhZxNRlr3pQX-d2mU4ORLGGyYKeaUGCRVSJOeOkNl6RJRhb-IpbPeo3tqvLGfHvyv8HhXVOwQ> | 0 | Vote Down this Answer<http://email.app.quandora.com/c/eJwVT0tqxDAUO81kZ-P_Z5FFCcw9np-fm7ZTO-Mknfb2dUACIYSQcE7d1nXKc9YFp49ZCemEUV5GE5XkRgjluIlORR7sXS9iWW5GwLbx5wk1tw4c2_e0zkGFIlNAJ0iRE1i0BiwpZhlSJo3TY16PY9tv-u2m7gNQ9xf1ndfzl9pVMrx3qtThMdRzMJs0RvnMwJJixgvBYkHNyGiHCMEB4Ij9tIOudHvVqzZ4IYuzTBWIzEiSLIFG5q1XxkZNjsTU58-0taN9Qb_enAn-rgX_ToNPww>

Reply to this message in order to post a comment on this answer.

Manage your notification preferences<http://email.app.quandora.com/c/eJwVjskKwyAYhJ8mHuV3i_HgoQTyHi6R2EWtGtq-fQ0MM_DBDOO0rSIdyGvPgkNRUyAzcCqJ4ooSzAHojLmaqcKL2NgK6zpxMKXg92mSz9Vgl1_o0N4Gw2YBMgTFglwkBOEJEEmYYtwz9NRH76VN7DbRbcik9tlrw-n87vkaGexsg4x87cNS7jFEZ3rMqaGq77bknh-mXgdOa35X6Q_SejtK>

© Quandora

04/28/2016

Hello,

Since there's no "DELETE" in NXQL, I'm writing a PHP Script using Nuxeo's REST. The first thing I'm doing in that script is to query all deleted Files using this first query (1) :

"Select * From File WHERE dc:created <= DATE '2016-04-19' AND ecm:currentLifeCycleState='deleted' "

This NXQL query allows me to retrieve the ID of deleted Files.

Then, I've read here :

https://answers.nuxeo.com/general/q/b97b181ae84341c9b98c23b75ad7163a/How-to-Add-Document-Deletion-feature-REST-

that it's possible to remove a Nuxeo Document through a HTTP Call using Nuxeo's REST API.

So I'm using, in my script, this :

" curl_setopt($ch, CURLOPT_URL, "http://{host}:{port}/nuxeo/restAPI/default/

{id_of_file_to_delete}/deleteDocumentRestlet"); "

The thing is : when I run my script, it seems to delete the File, because if I run the first query (1) again, the

ID of the File I "deleted" disappears.

But when I compare Nuxeo's size before and after the "deletion", it didn't change in fact. So I guess orphan binaries were not deleted.

Is there a way to delete theses orphan binaries with Nuxeo's REST API without using Nuxeo Studio ?

I found this topic : https://answers.nuxeo.com/general/q/0f0ae77c768b4b53b70542c9239abb4f/Action-Command-to-permanently-delete-all-

but the person answering recommended to use Nuxeo Studio.

I guess it's not possible through Nuxeo's Shell too (because of NXQL not allowing DELETE), right ?

Thanks in advance.

05/19/2016

Did you have a look at the "Contributing an automation chain" i mentionned ? This is a simple XML extension to write and you do not need Studio.

You will then be able to call the operation from PHP for instance

05/19/2016