Changes
Jump to navigation
Jump to search
← Older edit
Newer edit →
Backup scripts
(view source)
Revision as of 03:32, 26 March 2015
24 bytes added
,
03:32, 26 March 2015
→backup.sh
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]
Rafahsolis
Bureaucrats
,
Administrators
2,306
edits
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
Special pages
Printable version