Archiving trac project environment into a zip file

The following small script dumps all usable information from a trac project directory, then creates a .zip archive in the actual working directory. The zip will contain all lists from trac, a dump of the wiki structure, and a hot copy of the project dir itself.

#!/bin/bash
#env
tmpdir=`mktemp -d`
tracdir=/var/lib/trac.project.directory/
#dumps
trac-admin "$tracdir" hotcopy "${tmpdir}/full_backup"
trac-admin "$tracdir" wiki dump "${tmpdir}/wiki_dump"
#lists
trac-admin "$tracdir" wiki list > $tmpdir/wiki_list.txt
trac-admin "$tracdir" permission list > $tmpdir/permission_list.txt
trac-admin "$tracdir" ticket_type list > $tmpdir/ticket_type_list.txt
trac-admin "$tracdir" priority list > $tmpdir/priority_list.txt
trac-admin "$tracdir" severity list > $tmpdir/severity_list.txt
trac-admin "$tracdir" component list > $tmpdir/component_list.txt
trac-admin "$tracdir" version list > $tmpdir/version_list.txt
trac-admin "$tracdir" milestone list > $tmpdir/milestone_list.txt
trac-admin "$tracdir" resolution list > $tmpdir/resolution_list.txt
#zip'em
currdir=`pwd`
pushd "$tmpdir"
zip -r "${currdir}/trac-"`date +%Y-%m-%d_%H%M`"-backup.zip" .
popd
rm -rf "$tmpdir"

Linkbacks

Use the following URL for manually sending trackbacks: http://rigo.info/lib/plugins/linkback/exe/trackback.php/en:blog:archiving_trac_project_environment_into_a_zip_file
en/blog/archiving_trac_project_environment_into_a_zip_file.txt · Utolsó módosítás: 2009-07-06 00:00 (külső szerkesztés)
CC Attribution-Noncommercial-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0