Created
July 2, 2010 09:09
-
-
Save jstepien/461130 to your computer and use it in GitHub Desktop.
A script creating a static dump of a Trac instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
src=/path/to/trac | |
dst=$src.tmp | |
port=54134 | |
target=$dst/localhost\:$port | |
pidfile=$dst/pid | |
set -x | |
test -f $pidfile && kill `cat $pidfile` | |
rsync -a --delete $src/ $dst | |
cd $dst | |
nice tracd -p $port -b localhost --single-env $dst \ | |
--basic-auth="*",$dst/.htpasswd,$dst -d --pidfile=$pidfile || exit 1 | |
sqlite3 db/trac.db "update permission set username = 'anonymous' where \ | |
username = 'authenticated';" || exit 1 | |
wget -r -k -l 3 -t 3 -X /changeset -X browser -X log http://localhost:$port | |
rm $target/wiki/{{Trac,Wiki}*,*action=*,*format=*,*version=*} | |
rm $target/{timeline\?*,ticket/*format=*,report/*{format=,USER=}*} | |
rm $target/query*format=* | |
kill `cat $pidfile` || exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment