Skip to content

Commit

Permalink
clean_xml.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
andylytical committed Mar 8, 2024
1 parent 670d5e0 commit 10de46c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions install-upgrade/confluence/clean_xml.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/bash

# Exit script if any command fails
set -e

set -x
JAVA=/srv/confluence/app/jre/bin/java
JAR=/home/aloftus/atlassian-xml-cleaner-0.1.jar
RESTORE=/srv/confluence/home/restore
BACKDIR=/backups
XML=entities.xml
XML_OLD=$BACKDIR/$XML
XML_NEW=$RESTORE/$XML
ZIP=$(ls -t $RESTORE/xmlexport-*.zip | head -1)

unzip -l $ZIP
time unzip -d $BACKDIR $ZIP $XML
time $JAVA -jar $JAR $XML_OLD >$XML_NEW
time zip -j -u $ZIP $XML_NEW
unzip -l $ZIP
chown confluence:confluence $ZIP

0 comments on commit 10de46c

Please sign in to comment.