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 | |
---|
13 | DB_NAME=component_registry |
---|
14 | DB_USER=compreg |
---|
15 | OUTPUTDIR=/tmp/compregxml |
---|
16 | |
---|
17 | mkdir ${OUTPUTDIR} |
---|
18 | |
---|
19 | echo getting xml from database... |
---|
20 | |
---|
21 | psql -U ${DB_USER} ${DB_NAME} << EOF |
---|
22 | \copy xml_content (content) TO '/tmp/xmls.tmp' |
---|
23 | EOF |
---|
24 | |
---|
25 | echo processing into files |
---|
26 | |
---|
27 | # sed to strip out explicit newline characters |
---|
28 | # split to move into separate files |
---|
29 | cat /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.