Fwd: Cron <root at linode01> /root/bin/mediawiki-backup.sh

Karsten 'quaid' Wade kwade at redhat.com
Mon Nov 26 15:40:49 UTC 2012


On 11/15/2012 12:42 AM, Dave Neary wrote:
> Hi,
> 
> The suggestion I made yesterday on IRC concerning these emails was to
> strip the leading / from filenames in the back-up script (I am assuming
> that we have a list of files to back up, and that they are provided in a
> file list provided to -T or --files-from - get files to archive from
> filename) and provide -C / as an argument (that is, set working
> directory to / for the archival).
> 
> Obviously, without access to the backup script, it's hard to recommend a
> specific fix. Is mediawiki-backup.sh in source control somewhere?

Nope, we don't have anything in git yet.

Here it is:

#!/bin/bash
DATE=`date +%Y%m%d`
CONF="LocalSettings.php"
CONFREADONLY="LocalSettings.php.readonly"
CONFWRITE="LocalSettings.php.writeable"
CHARSET="latin1"
DB="wikidb"
PASS="PASSWORD"
USER="wikiuser"
HOST="localhost"
TAROPTS="-czhf"
FILES="/var/www/html/w/images/ /var/www/html/w/LocalSettings.php
/var/www/html/w/extensions/ /var/www/html/w/includes/
/var/www/html/w/skins/"

# Lock MediaWiki with the config file
cp /var/www/html/w/$CONFREADONLY /var/www/html/w/$CONF

# Backup database
mysqldump --add-drop-table -h $HOST -u $USER -p$PASS
--default-character-set=$CHARSET $DB | bzip2 -c >
/root/backups/mediawiki_db_backup-$DATE.sql.bz2

# Backup files
tar $TAROPTS /root/backups/mediawiki_files_backup-$DATE.tgz $FILES

# Unlock MediaWiki
cp /var/www/html/w/$CONFWRITE /var/www/html/w/$CONF


-- 
Karsten 'quaid' Wade, Sr. Analyst - Community Growth
http://TheOpenSourceWay.org  .^\  http://community.redhat.com
@quaid (identi.ca/twitter/IRC)  \v'  gpg: AD0E0C41

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 253 bytes
Desc: OpenPGP digital signature
URL: <http://lists.ovirt.org/pipermail/infra/attachments/20121126/1ffd3f2e/attachment.sig>


More information about the Infra mailing list