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.
10 This information can always be recalculated by rebuilding the wiki.
11 (So the file is safe to delete and need not be backed up.)
12 It used to be a (semi) human-readable text file, but is not anymore.
14 To dump the contents of the file, enter a perl command like this.
16 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $index=Storable::retrieve("indexdb"); use Data::Dumper; print Dumper $index' | head
19 'ctime' => 1199739528,
23 'mtime' => 1199739528,
24 'src' => 'index.mdwn',
30 `.ikiwiki/userdb` is the user database, which records preferences of all
33 To list all users in the database, enter a perl command like this.
34 Note that the output can include both registered users, and known
37 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); print $_ foreach keys %$userinfo'
38 http://joey.kitenet.net/
41 To list each user's email address:
43 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); print $userinfo->{$_}->{email} foreach keys %$userinfo'
47 To dump the entire database contents:
49 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); use Data::Dumper; print Dumper $userinfo'
51 'http://joey.kitenet.net/' => {
52 'email' => 'joey@kitenet.net',
55 Editing values is simply a matter of changing values and calling `Storable::nstore()`.
56 So to change a user's email address:
58 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")'
62 joey@kodama:~/src/joeywiki/.ikiwiki> perl -le 'use Storable; my $userinfo=Storable::retrieve("userdb"); delete $userinfo->{"foo"}; Storable::lock_nstore($userinfo, "userdb")'
64 I've not written actual utilities to do this yet because I've only needed
65 to do it rarely, and the data I've wanted has been different each time.
68 ## the session database
70 `.ikiwiki/sessions.db` is the session database. See the [[!cpan CGI::Session]]
71 documentation for more details.
75 In case you're curious, here's what the various lock files do.
77 * `.ikiwiki/lockfile` is the master ikiwiki lock file. Ikiwiki takes this
78 lock before reading/writing state.
79 * `.ikiwiki/commitlock` is locked as a semophore, to disable the commit hook
81 * `.ikiwiki/cgilock` is locked by the cgi wrapper, to ensure that only
82 one ikiwiki process is run at a time to handle cgi requests.
86 Some plugins create other files to store their state.
88 * `.ikiwiki/aggregate` is a plain text database used by the aggregate plugin
89 to record feeds and known posts.
90 * `.ikiwiki/xapian/` is created by the search plugin, and contains xapian-omega
91 configuration and the xapian database.