WikiCVSStorage

Summary: Use CVS to backup/archive your wiki.
Version: 1.0
Maintainer: BenWilson
Categories: WikiFarms, PIM, SystemTools

Goal

When I'm in graduate school, I plan to use PmWiki to help me keep organized and take notes. However, I need to keep those notes synchronized on several systems, and safeguarded from fatal server errors. What to do?

Solution

My solution is to use CVS. Basically, I entered the entire PmWiki directory (which is wiki/ for me) into CVS, which nicely includes wiki.d. Then, I used cron to make regular, automatic backups of the project. This solution assumes you have CVS installed and have basic understanding on how to use it.

Script used: I provide a template of my cron script for the automatic updates. wikicvs.txtΔ

  1. Share SSH Public Key between project server and CVS repository server. This assumes that the two are not the same server. Since I will be keeping the project on several different computers, this is the case with me. See the page below on the details on sharing the key.
    1. Create the key: Do not use a password. Also, the filename should be the default.
      ssh-keygen -t dsa
    2. Verify the key was generated.
      ls -l ~/.ssh/id_dsa.pub
    3. Use SCP to copy the key to the remote server:
      scp ~/.ssh/id_dsa.pub remote:~/.ssh/public-key.tmp
    4. At the remote server, add the key to the authorized-hosts list
      cat ~/.ssh/public-key.tmp>>authorized_keys
  2. Create CVS project for the wiki/.
    cvs import -m "New Project" wiki/ username start
    Read the CVS Documentation for more information.
  3. Establish cron using attached script. My cronline reads thus:
    0 0,4,8,12,16,20 * * * ~/wikicvs.sh >>/dev/null 2>&1
    You will need to configure one variable WIKIHOME in the script to tell the script where to do the voodoo that it do.

Discussion

I use SSH to connect to the CVS repository, even when I'm on the same server. This is because I use CVS to keep synchronized my various computers and want uniformity. Regardless, to use CVS with cron, I need to be able to use SSH without using a password. Sharing the public key as it is described above allows for this.

Then, I just create the project ala CVS. This can lead to a problem where the permissions of the files are screwed up, causing a painful experience when you try to use PmWiki after you've CVS'd. So, in the accompanying script, after the repository is updated the permissions are fixed.

See Also

History

2004-07-09: Initial revision.

Comments & Bugs

Leave this field for future bugs or comments for your script

Just a quick note that Subversion works well for this also. --ShaneSimmons?

Contributors

Copyright

2004 Benjamin C. Wilson. GNU General Public License


Ben Wilson Maintained

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.