On Mon, Aug 25, 2014 at 05:51:52PM +0200, Tanguy Ortolo wrote:
> Hello,
> 
> Rodrigo Campos, 2014-07-25 19:12+0100:
> >The dokuwiki installation doesn't ever erase the cache. In my installation 
> >the
> >cache was using 750M and the whole data directory, excluding the cache, was 
> >20M.
> >
> >When looking how to erase the cache, I found this:
> >https://www.dokuwiki.org/tips:maintenance
> >
> >Based on that, I did a script to erase the cache and some other stale files 
> >that
> >page recommends. And also update the wordlist. I attach the script just in 
> >case
> >is useful for you.
> >
> >Please consider fixing this using the script or in some other way.
> 
> Thank you for reporting this issue. I used your script as a daily
> crontab script, with some modifications:
> * switch to pure /bin/sh;
> * use find -delete instead of find | xargs rm;
> * make it modular so the user can configure in /etc/default/dokuwiki
> whether or not to run the cleanup at all (default: yes), after how
> many days a file is to be considered as old (default: 180), whether
> or   not to remove old revisions (default: NO!), and whether or not
> to   update the spam blacklist (default: no, as it implies importing
> data   from outside, which may or may not be possible or desirable
> depending   on the case).

Great!

> 
> Given the importance of this modification, and the level of damage
> it could do if we made a mistake (it deletes file in a wiki data
> directory!), I will upload this revision to experimental: could you
> please test it and confirm it does not delete production data? Only
> after that will I be able to upload it to unstable.

Sure! I've just tried it and I can confirm it worked fine on my production
system. Let me explain how I tried it, just in case:

I installed the dokuwiki in my local PC, copied the cron file to my server (I've
done a snapshot just before trying this, of course ;) and changed all default
from false to true (so I try all the cases). Oh, and also commented the source
to /etc/default/dokuwiki as that file does not exist on my installation from
stable. Then run the script and everything went fine.

I didn't test changing the date of the files and verify they are deleted, but
that should work.

I've detected a very simple problem on my local machine, though. The line that
says:

        find cache/?/ -type f -mtime "+$max_days" -delete

fails on a new dokuwiki installation. And it faile because the cache directory
is empty on a brand new installation. Just changing it to:

        find cache -type f -mtime "+$max_days" -delete

works just fine (the "/?/" is not really important, as the filter for "-type f"
is there) because the cache directory is created during the installation.


If you want me to test something else, please let me know :)




Thanks a lot,
Rodrigo


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to