DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:maintenance

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tips:maintenance [2019-02-18 12:51] – See also the plugins... Michaelsytips:maintenance [2022-09-28 22:54] – [Keeping Playground Clean] Remove -p from example commands; -p causes the pages to not refresh since the timestamp remains the same 2601:543:4001:9fa0:403e:b893:5604:64ce
Line 3: Line 3:
 Here are some tips to automate some of the day-to-day maintenance needed or recommended for DokuWiki. Here are some tips to automate some of the day-to-day maintenance needed or recommended for DokuWiki.
  
-See also the plugins: [[doku>plugin:cleanup|cleanup]] and [[doku>plugin:clearhistory|clearhistory]]+See also the plugins: [[plugin:cleanup|cleanup]] and [[plugin:clearhistory|clearhistory]]
  
 ===== 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>Bash (Unix shell)]] shell script serves as an example. It deletes old revisions from the [[:attic]], removes stale lock files and empty directories, and it cleans up the [[:caching|cache]]((For a discussion of cache maintenance see also the [[http://forum.dokuwiki.org/post/22265|forum discussion]].)).+It is recommended to set up some cleanup process for busy DokuWikis. The following [[wp>Bash (Unix shell)]] shell script serves as an example. It deletes old revisions from the [[:attic]], removes stale lock files and empty directories, and it cleans up the [[:caching|cache]]((For a discussion of cache maintenance see also the [[https://forum.dokuwiki.org/post/22265|forum discussion]].)).
  
 <file bash cleanup.sh> <file bash cleanup.sh>
 #!/bin/bash #!/bin/bash
  
-function cleanup()+cleanup()
 { {
     local data_path="$1"        # full path to data directory of wiki     local data_path="$1"        # full path to data directory of wiki
Line 22: Line 22:
  
     # purge files older than ${retention_days} days from attic and media_attic (old revisions)     # purge files older than ${retention_days} days from attic and media_attic (old revisions)
-    find "${data_path}"/{media_,}attic/ -type f -mtime +${retention_days} -delete+    find "${data_path}"/{media_,}attic/ -type f -not -name _dummy -mtime +${retention_days} -delete
  
     # remove stale lock files (files which are 1-2 days old)     # remove stale lock files (files which are 1-2 days old)
Line 34: Line 34:
     if [ -e "${data_path}"/cache/?/ ]     if [ -e "${data_path}"/cache/?/ ]
     then     then
-        find "${data_path}"/cache/?/ -type f -mtime +${retention_days} -delete+        find "${data_path}"/cache/?/ -type f -not -name _dummy -mtime +${retention_days} -delete
     fi     fi
 } }
Line 83: Line 83:
  
 ==== 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://gnuwin32.sourceforge.net/]] The script uses the free and open source utility find, which can be obtained via [[http://gnuwin32.sourceforge.net/]]
Line 186: Line 187:
 Example: Restore Playground every 30 min: Example: Restore Playground every 30 min:
  
-  0,30 * * * * cp -pf /path/to/savedwiki/data/pages/playground/playground.txt /path/to/dokuwiki/data/pages/playground/+  0,30 * * * * cp -/path/to/savedwiki/data/pages/playground/playground.txt /path/to/dokuwiki/data/pages/playground/
  
 Example: Restore all pages in [[:namespace]] "wiki" every 30 min: Example: Restore all pages in [[:namespace]] "wiki" every 30 min:
  
-  0,30 * * * * cp -rpf /path/to/savedwiki/data/pages/wiki/ /path/to/dokuwiki/data/pages/wiki/+  0,30 * * * * cp -rf /path/to/savedwiki/data/pages/wiki/ /path/to/dokuwiki/data/pages/wiki/
  
 ==== Problems with CAPTCHA plugin ==== ==== Problems with CAPTCHA plugin ====
 +
 Using the CAPTCHA plugin and the recommended [[tips:maintenance#keeping_playground_clean|maintenance method]] to keep the playground clean, can result in the effect of being unable to edit the playground. Using the CAPTCHA plugin and the recommended [[tips:maintenance#keeping_playground_clean|maintenance method]] to keep the playground clean, can result in the effect of being unable to edit the playground.
  
Line 199: Line 201:
 Example: Deletes Playground metafiles every 30 min: Example: Deletes Playground metafiles every 30 min:
   0,30 * * * * rm -f /path/to/dokuwiki/data/meta/playground/playground.*   0,30 * * * * rm -f /path/to/dokuwiki/data/meta/playground/playground.*
 +
 ===== When cronjob is not available ===== ===== When cronjob is not available =====
  
Line 213: Line 216:
 ---- ----
  
-Could someone add the appropriate line for [[http://forum.dokuwiki.org/post/22265|cache maintenance]] to the Windows waRmZip script?+Could someone add the appropriate line for [[https://forum.dokuwiki.org/post/22265|cache maintenance]] to the Windows waRmZip script?
 ---- ----
 Does the [[plugin:cleanup|cleanup Plugin]] handle all the above tasks? Would it be recommended over running these scripts? Does the [[plugin:cleanup|cleanup Plugin]] handle all the above tasks? Would it be recommended over running these scripts?
tips/maintenance.txt · Last modified: 2023-10-10 20:28 by staze

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki