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.