Getting a wiki from the server
#!/bin/bash
if [ -e wiki_is_local ]; then
echo "Wiki is already locally instantiated"
exit
fi
echo "Downloading files"
rsync -xavz --exclude LocalSettings.php root@sigtrans.org:/home/nens/wiki /home/nens/
echo "Downloading database"
mysqldump -C --host=213.239.213.249 --user=NensWiki --password=passwd NensWiki >server_state.sql
echo "Inserting in local database"
mysql -h localhost -u NensWiki --password=passwd -D NensWiki
Putting a wiki towards the server
#!/bin/bash
echo "Creating local copy of database"
mysqldump -C --host=localhost --user=NensWiki --password=passwd NensWiki >local_state.sql
echo "Synchronizing mediawiki directory"
rsync -xavz --exclude LocalSettings.php /home/nens/wiki root@sigtrans.org:/home/nens/
echo "Synchronizing remote database"
mysql -C -h 213.239.213.249 -u NensWiki --password=passwd -D NensWiki