Dokuwiki Tips

清除特定頁面 cache

在該頁面網址後面加上

1
?purge=true

clean cache script

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

cleanup() {
# $1 ... full path to data directory of wiki
# $2 ... number of days after which old files are to be removed

# purge files older than $2 days from attic and media_attic (old revisions)
find "$1"/{media_,}attic/ -type f -mtime +$2 -print0 | xargs -0r rm -f

# remove stale lock files (files which are 1-2 days old)
find "$1"/locks/ -name '*.lock' -type f -mtime +1 -print0 | xargs -0r rm -f

# remove empty directories
find "$1"/{attic,cache,index,locks,media,media_attic,media_meta,meta,pages,tmp}/ \
-mindepth 1 -type d -empty -print0 | xargs -0r rmdir

# remove files older than $2 days from the cache
find "$1"/cache/?/ -type f -mtime +$2 -print0 | xargs -0r rm -f
}

使用方式:

1
$ ./cleanwiki.sh <path of dokuwiki>/data <天數>

Ref