source: ComponentRegistry/trunk/ComponentRegistry/src/main/sql/dumpxml.sh @ 1885

Last change on this file since 1885 was 1885, checked in by twagoo, 12 years ago

Added script for dumping XML from compreg db

  • Property svn:executable set to *
File size: 777 bytes
Line 
1#!/bin/sh
2
3####################################################################################
4# This script dumps all xml content from the component registry
5# database into separate files.
6#
7# THIS WILL INCLUDE PRIVATE AND DELETED COMPONENTS AND PROFILES
8#
9# Use with care...
10#
11####################################################################################
12
13DB_NAME=component_registry
14DB_USER=compreg
15OUTPUTDIR=/tmp/compregxml
16
17mkdir ${OUTPUTDIR}
18
19echo getting xml from database...
20
21psql -U ${DB_USER} ${DB_NAME} << EOF
22\copy xml_content (content) TO '/tmp/xmls.tmp'
23EOF
24
25echo processing into files
26
27# sed to strip out explicit newline characters
28# split to move into separate files
29cat /tmp/xmls.tmp | sed -e 's/\\n//g' | split -a 5 -l 1 - ${OUTPUTDIR}/compreg.xml.
30
Note: See TracBrowser for help on using the repository browser.