tips:maintenance
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
tips:maintenance [2013-04-29 20:21] – [Maintenance] 190.27.194.177 | tips:maintenance [2023-10-10 20:28] (current) – Updated to fix errors with the fact if -e does not work for globs. staze | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Maintenance ====== | ====== Maintenance ====== | ||
+ | Here are some tips to automate some of the day-to-day maintenance needed or recommended for DokuWiki. | ||
- | + | See also the plugins: [[plugin: | |
- | Here are some tips to automate some of the day-to-day maintenance needed or recommended for DokuWiki. | + | |
===== Keep Blacklist up to date ===== | ===== Keep Blacklist up to date ===== | ||
Line 11: | Line 11: | ||
===== Automatic cleanup script ===== | ===== Automatic cleanup script ===== | ||
- | It is recommended to set up some cleanup process for busy DokuWikis. The following [[wp> | + | It is recommended to set up some cleanup process for busy DokuWikis. The following [[wp> |
<file bash cleanup.sh> | <file bash cleanup.sh> | ||
#!/bin/bash | #!/bin/bash | ||
- | cleanup() { | + | cleanup() |
+ | { | ||
+ | local data_path=" | ||
+ | local retention_days=" | ||
- | | + | |
- | # $2 ... number of days after which old files are to be removed | + | find " |
- | | + | |
- | find "$1"/{media_,}attic/ -type f -mtime +$2 -print0 | xargs -0r rm -f | + | find "${data_path}"/ |
- | | + | |
- | find "$1"/ | + | find "${data_path}"/{attic, |
+ | | ||
- | | + | |
- | find "$1"/{attic,cache, | + | if test -n "$(find "${data_path}"/ |
- | | + | then |
- | + | find "${data_path}"/ | |
- | # remove files older than $2 days from the cache | + | fi |
- | | + | |
} | } | ||
+ | |||
# cleanup DokuWiki installations (path to datadir, number of days) | # cleanup DokuWiki installations (path to datadir, number of days) | ||
Line 51: | Line 55: | ||
==== Windows -- warmzip ==== | ==== Windows -- warmzip ==== | ||
- | A script for cleaning out old files on Windows systems is [[http:// | + | A script for cleaning out old files on Windows systems is [[http:// |
I took the above suggestion to use '' | I took the above suggestion to use '' | ||
- | My favorite way to run cron jobs on Windows is [[http://www.kalab.com/freeware/pycron/pycron.htm|PyCron]]. | + | My favorite way to run cron jobs on Windows is [[https://sourceforge.net/projects/ |
<file dos dw-cleanup.bat> | <file dos dw-cleanup.bat> | ||
Line 80: | Line 84: | ||
==== Windows -- batch script ==== | ==== Windows -- batch script ==== | ||
+ | |||
This is another Windows command shell script for maintaining your dokuwiki base on a Windows environment. | This is another Windows command shell script for maintaining your dokuwiki base on a Windows environment. | ||
The script uses the free and open source utility find, which can be obtained via [[http:// | The script uses the free and open source utility find, which can be obtained via [[http:// | ||
Line 183: | Line 188: | ||
Example: Restore Playground every 30 min: | Example: Restore Playground every 30 min: | ||
- | 0,30 * * * * cp -pf / | + | 0,30 * * * * cp -f / |
Example: Restore all pages in [[: | Example: Restore all pages in [[: | ||
- | 0,30 * * * * cp -rpf / | + | 0,30 * * * * cp -rf / |
+ | |||
+ | ==== Problems with CAPTCHA plugin ==== | ||
+ | |||
+ | Using the CAPTCHA plugin and the recommended [[tips: | ||
+ | |||
+ | When this occurs, the problem can be easily resolved by removing the related playground files in the meta folder with the next cronjob. | ||
+ | |||
+ | Example: Deletes Playground metafiles every 30 min: | ||
+ | 0,30 * * * * rm -f / | ||
===== When cronjob is not available ===== | ===== When cronjob is not available ===== | ||
Line 203: | Line 217: | ||
---- | ---- | ||
- | Could someone add the appropriate line for [[http:// | + | Could someone add the appropriate line for [[https:// |
+ | ---- | ||
+ | Does the [[plugin: | ||
---- | ---- | ||
Line 268: | Line 284: | ||
</ | </ | ||
use this at your own risk. --- [[user> | use this at your own risk. --- [[user> | ||
+ | |||
+ | ---- | ||
+ | Cheers, I'd like to add that it is a good idea to clean up orphaned meta data, don't you think? | ||
+ | I do the following (in an R script): | ||
+ | -list all files in the pages directory recursively | ||
+ | -add a column ' | ||
+ | -in pagename exchange '/' | ||
+ | -do the same for the meta directory + exclude some additional files | ||
+ | -remove all entries from the meta-list from which the page name is in the pages-list | ||
+ | -delete all files left in the meta list | ||
+ | Of course one could add a time constraint on it so that you don't use metadata immediately. | ||
+ | |||
+ | Clemo // | ||
tips/maintenance.1367259697.txt.gz · Last modified: by 190.27.194.177