Changes

Jump to navigation Jump to search
24 bytes added ,  03:32, 26 March 2015
Line 5: Line 5:  
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).
 
== backup.sh ==
 
== backup.sh ==
  <nowiki>
+
  <source lang="bash">
 
#!/bin/bash
 
#!/bin/bash
 
FNAME=TS=RHSWiki`date +%d-%m-%Y`
 
FNAME=TS=RHSWiki`date +%d-%m-%Y`
Line 11: Line 11:  
zip -r ./backup/${FNAME}.zip images/ ${FNAME}.sql LocalSettings.php extensions/
 
zip -r ./backup/${FNAME}.zip images/ ${FNAME}.sql LocalSettings.php extensions/
 
rm ${FNAME}.sql
 
rm ${FNAME}.sql
  </nowiki>
+
  </source>
 
Bonus (not required):
 
Bonus (not required):
  <nowiki>
+
  <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 32: Line 32:  
file_count=`ls | wc -l`
 
file_count=`ls | wc -l`
 
done
 
done
  </nowiki>
+
  </source>
 
[http://www.mediawiki.org/wiki/User:Flominator/Backup_MW Source]
 
[http://www.mediawiki.org/wiki/User:Flominator/Backup_MW Source]

Navigation menu