Skip to content

Instantly share code, notes, and snippets.

@jstepien
Created July 2, 2010 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstepien/461130 to your computer and use it in GitHub Desktop.
Save jstepien/461130 to your computer and use it in GitHub Desktop.
A script creating a static dump of a Trac instance
#!/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