Changes

Jump to navigation Jump to search
428 bytes added ,  15:04, 10 April 2019
m
Line 1: Line 1: −
= HD dd =
+
=HD dd=
<source lang=bash>#!/bin/bash
+
<source lang="bash">#!/bin/bash
 
USAGE="./$(basename ${0}) UUID output_filename"
 
USAGE="./$(basename ${0}) UUID output_filename"
   Line 21: 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 27: 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 36: 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 56: 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 />

Navigation menu