差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

dokuwiki:ja:maintenance [2006/11/21] – 作成 admindokuwiki:ja:maintenance [2006/11/21] (現在) – 外部編集 (不明な日付) 127.0.0.1
行 1: 行 1:
 +====== メンテナンス ======
 +
 +Here are some tips to automate some of the day-to-day maintenance needed for Dokuwiki
 +
 +===== Keep Blacklist up to date =====
 +
 +See [[wiki:blacklist]] on how to set up a cronjob to keep the Anti-Spam Blacklist current
 +
 +===== Automatic cleanup script =====
 +
 +It is recommended to set up some cleanup process for busy DokuWikis. The following script is an example how to do that. It deletes all revisions which are older than 30 days from the [[wiki:attic|attic]] and removes stale lock files and empty directories.
 +
 +<code bash>
 +#!/bin/sh
 +
 +# set the path to your DokuWiki installation here
 +DOKUWIKI=/path/to/your/wiki
 +
 +# purge files older than 30 days from the attic
 +find $DOKUWIKI/data/attic/ -type f -mtime +30 -exec rm -f {} \;
 +
 +# remove stale lock files
 +find $DOKUWIKI/data/pages/ -name '*.lock' -type f -mtime +1 -exec rm -f {} \;
 +
 +# remove empty directories
 +find $DOKUWIKI/data/pages/ -depth -type d -empty -exec rmdir {} \;
 +</code>
 +>Should we include a line to clean out the meta directory too?\\
 +>find $DOKUWIKI/data/meta/ -depth -type d -empty -exec rmdir {} \;
 +>\\
 +
 +To run it automatically, set up a [[man>crontab(5)|cronjob]]. The following example calls the script every day 5 minutes after midnight:
 +
 +  5 0 * * *   /full/path/to/cleanup.sh
 +
 +Be sure to set everything up correctly - you don't want to delete the wrong things, do you?
 +
 +===== Keeping Playground Clean =====
 +
 +To keep the wiki's Playground and other pages clean, use  a cron job every 30 min, that restores Playground and other pages to their original content.
 +
 +Example: Restore [[playground:Playground]] every 30 min:
 +
 +  0,30 * * * * cp -rpf /path/to/savedwiki/data/playground/playground.txt /path/to/dokuwiki/data/playground/
 +
 +Example: Restore all pages in [[wiki:namespace]] "wiki" every 30 min:
 +
 +  0,30 * * * * cp -rpf /path/to/savedwiki/data/wiki/ /path/to/dokuwiki/data/wiki/
 +