| Line 1: |
Line 1: |
| − | = HD dd = | + | =HD dd= |
| − | <source lang=bash>#!/bin/bash | + | <source lang="bash">#!/bin/bash |
| − | | |
| − | # UUID="d3438d58-1a53-470d-934d-fe4cd7aaca06" /
| |
| − | # dev/sdl1: PARTUUID="2c42328a-01" grub?
| |
| − | | |
| − | | |
| | USAGE="./$(basename ${0}) UUID output_filename" | | USAGE="./$(basename ${0}) UUID output_filename" |
| | | | |
| Line 26: |
Line 21: |
| | dd if=${HD} of=${ISO} bs=1M</source> | | dd if=${HD} of=${ISO} bs=1M</source> |
| | | | |
| − | = MediaWiki = | + | =MediaWiki= |
| | + | |
| | + | == With database dump == |
| | First add the following line to LocalSetings.php | | First add the following line to LocalSetings.php |
| | <nowiki>$wgReadOnly = 'Dumping Database, Access will be restored shortly';</nowiki> | | <nowiki>$wgReadOnly = 'Dumping Database, Access will be restored shortly';</nowiki> |
| Line 32: |
Line 29: |
| | The script should be in the MediaWiki installation (where your [[LocalSettings.php]] is stored as well). | | The script should be in the MediaWiki installation (where your [[LocalSettings.php]] is stored as well). |
| | | | |
| − | == mediawiki_mysql_backup.sh == | + | ==mediawiki_mysql_backup.sh== |
| − | <source lang="bash">
| + | <source lang="bash"> |
| | #!/bin/bash | | #!/bin/bash |
| | FNAME=TS=RHSWiki`date +%d-%m-%Y` | | FNAME=TS=RHSWiki`date +%d-%m-%Y` |
| Line 41: |
Line 38: |
| | </source> | | </source> |
| | Bonus (not required): | | Bonus (not required): |
| − | <source lang="bash">
| + | <source lang="bash"> |
| | # careful here .. if this fails you'll delete files from the current directory instead. | | # careful here .. if this fails you'll delete files from the current directory instead. |
| | # Some checking might be in order, especially if you run this script from somewhere else | | # Some checking might be in order, especially if you run this script from somewhere else |
| Line 61: |
Line 58: |
| | done | | done |
| | </source> | | </source> |
| − | [http://www.mediawiki.org/wiki/User:Flominator/Backup_MW Source] | + | |
| | + | == With automysqlbackup == |
| | + | <syntaxhighlight lang="bash"> |
| | + | #!/bin/bash |
| | + | DATE=$(date +"%Y-%d-%m") |
| | + | /usr/sbin/automysqlbackup |
| | + | rsync -avp /var/lib/automysqlbackup/daily/wikidb /root/wikibackup/tmp/ |
| | + | rsync -avLp /var/www/mediawiki /root/wikibackup/tmp/ |
| | + | cd /root/wikibackup/tmp/ |
| | + | tar -czvf "/root/wikibackup/wikibackup-${DATE}.tar.gz" * |
| | + | mv "/root/wikibackup/wikibackup-${DATE}.tar.gz" /tmp/ |
| | + | |
| | + | </syntaxhighlight>[http://www.mediawiki.org/wiki/User:Flominator/Backup_MW Source] |
| | + | <br /> |