cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting files

ltardioli
Champ in-the-making
Champ in-the-making
Hi ppl!

I'm trying  to build a script to delete some files when this files expires.

For exemple: One file is uploaded to the repository, after 10 days this file must be deleted.

I'm trying to do this using cron to execute a JavaScript that verify if the file is ok to delete or not.

The problem is that I dont even know if cron executes a javascript.
If somebody has any ideia…
thanks!
3 REPLIES 3

lementree
Champ on-the-rise
Champ on-the-rise
Hi

From cron you can run script through script action.

jonash
Champ in-the-making
Champ in-the-making
If you turn your script into a web script it is possible to call it form cron using curl.


curl -d '' -u user:pass http://server:8080/alfresco/service/your/webscript

Here is a good introduction to web scripts: http://ecmarchitect.com/images/articles/alfresco-webscripts/web-script-article.pdf

jonash
Champ in-the-making
Champ in-the-making
Another option would be to create a scheduled action that executes the script. Loftux gives an example in this forum thread: https://forums.alfresco.com/en/viewtopic.php?p=115018#p115018