Parametrize dump-wikis.sh and backup mediawiki sites in dump-wikis.sh
[simantics/platform.git] / releng / doc / dump-wikis.sh
1 #!/bin/bash
2
3 if [ $# -lt 3 ]; then
4         echo "Usage: $0 <major> <minor> <service>"
5         exit -1
6 fi
7
8 major=$1
9 minor=$2
10 service=$3
11 ver=${major}.${minor}.${service}
12
13 mkdir ${ver}
14 cd ${ver}
15 OLDIFS=$IFS
16 IFS=','
17 for db in enduserwikidb,enduserwikiuser devwikidb,devwikiuser; do
18         set $db
19         sh ../dump-mysql-db.sh ${major} ${minor} ${service} ${1} ${2}
20 done
21 IFS=$OLDIFS
22
23 cd ..
24 tar zcvf ${ver}.tar.gz ${ver}
25 rm -rf ${ver}
26
27 echo "Packing up mediawiki sites"
28 tar zcvf ${ver}-dev-site.tar.gz /var/www/http-dev.simantics.org/
29 tar zcvf ${ver}-enduser-site.tar.gz /var/www/https-www.simantics.org/end_user_wiki/