1 [[!meta title="inside .ikiwiki"]]
2 [[!meta date="2008-03-21 13:52:50 -0400"]]
4 The `.ikiwiki` directory contains ikiwiki's internal state. Normally,
5 you don't need to look in it, but here's some tips for how to do so if
10 `.ikiwiki/indexdb` contains a cache of information about pages.
11 This information can always be recalculated by rebuilding the wiki.
12 (So the file is safe to delete and need not be backed up.)
13 It used to be a (semi) human-readable text file, but is not anymore.
15 To dump the contents of the file, enter a perl command like this.
17 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $index=Storable::retrieve("indexdb"); use Data::Dumper; print Dumper $index' | head
20 'ctime' => 1199739528,
24 'mtime' => 1199739528,
25 'src' => 'index.mdwn',
31 `.ikiwiki/userdb` is the user database, which records preferences of all
34 To list all users in the database, enter a perl command like this.
35 Note that the output can include both registered users, and known
38 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); print $_ foreach keys %$userinfo'
39 http://joey.kitenet.net/
42 To list each user's email address:
44 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); print $userinfo->{$_}->{email} foreach keys %$userinfo'
48 To dump the entire database contents:
50 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); use Data::Dumper; print Dumper $userinfo'
52 'http://joey.kitenet.net/' => {
53 'email' => 'joey@kitenet.net',
56 Editing values is simply a matter of changing values and calling `Storable::nstore()`.
57 So to change a user's email address:
59 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); $userinfo->{"foo"}->{email}=q{foo@bar}; Storable::lock_nstore($userinfo, "userdb")'
63 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); delete $userinfo->{"foo"}; Storable::lock_nstore($userinfo, "userdb")'
65 I've not written actual utilities to do this yet because I've only needed
66 to do it rarely, and the data I've wanted has been different each time.
69 ## the session database
71 `.ikiwiki/sessions.db` is the session database. See the [[!cpan CGI::Session]]
72 documentation for more details.
76 In case you're curious, here's what the various lock files do.
78 * `.ikiwiki/lockfile` is the master ikiwiki lock file. Ikiwiki takes this
79 lock before reading/writing state.
80 * `.ikiwiki/commitlock` is locked as a semophore, to disable the commit hook
82 * `.ikiwiki/cgilock` is locked by the cgi wrapper, to ensure that only
83 one ikiwiki process is run at a time to handle cgi requests.
87 Some plugins create other files to store their state.
89 * `.ikiwiki/aggregate` is a plain text database used by the aggregate plugin
90 to record feeds and known posts.
91 * `.ikiwiki/xapian/` is created by the search plugin, and contains xapian-omega
92 configuration and the xapian database.