1 [[!meta title="inside .ikiwiki"]]
3 The `.ikiwiki` directory contains ikiwiki's internal state. Normally,
4 you don't need to look in it, but here's some tips for how to do so if
9 `.ikiwiki/indexdb` contains a cache of information about pages, as well
10 as all persisitant state about pages. It used to be a (semi) human-readable
11 text file, but is not anymore.
13 To dump the contents of the file, enter a perl command like this.
15 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $index=Storable::retrieve("indexdb"); use Data::Dumper; print Dumper $index' | head
18 'ctime' => 1199739528,
22 'mtime' => 1199739528,
23 'src' => 'index.mdwn',
29 `.ikiwiki/userdb` is the user database, which records preferences of all
32 To list all users in the database, enter a perl command like this.
33 Note that the output can include both registered users, and known
36 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); print $_ foreach keys %$userinfo'
37 http://joey.kitenet.net/
40 To list each user's email address:
42 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); print $userinfo->{$_}->{email} foreach keys %$userinfo'
46 To dump the entire database contents:
48 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); use Data::Dumper; print Dumper $userinfo'
50 'http://joey.kitenet.net/' => {
51 'email' => 'joey@kitenet.net',
54 Editing values is simply a matter of changing values and calling `Storable::nstore()`.
55 So to change a user's email address:
57 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")'
61 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); delete $userinfo->{"foo"}; Storable::lock_nstore($userinfo, "userdb")'
63 I've not written actual utilities to do this yet because I've only needed
64 to do it rarely, and the data I've wanted has been different each time.
67 ## the session database
69 `.ikiwiki/sessions.db` is the session database. See the [[!cpan CGI::Session]]
70 documentation for more details.
74 In case you're curious, here's what the various lock files do.
76 * `.ikiwiki/lockfile` is the master ikiwiki lock file. Ikiwiki takes this
77 lock before reading/writing state.
78 * `.ikiwiki/commitlock` is locked as a semophore, to disable the commit hook
80 * `.ikiwiki/cgilock` is locked by the cgi wrapper, to ensure that only
81 one ikiwiki process is run at a time to handle cgi requests.
85 Some plugins create other files to store their state.
87 * `.ikiwiki/aggregate` is a plain text database used by the aggregate plugin
88 to record feeds and known posts.
89 * `.ikiwiki/xapian/` is created by the search plugin, and contains xapian-omega
90 configuration and the xapian database.