Created
July 26, 2012 04:15
-
-
Save yoneken/3180221 to your computer and use it in GitHub Desktop.
A shell script for backup a mediawiki data.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
filename=~/bkup/wiki$(date +%Y%m%d).xml | |
ssh mediawiki_serv php ./www/wiki/maintenance/dumpBackup.php --full > $filename | |
md5=`md5sum $filename | cut -c 1-32` | |
lmd5=`cat ~/bkup/last_md5` | |
if [ "$lmd5" != "$md5" ] | |
then | |
echo "$md5" > ~/bkup/last_md5 | |
#echo "The latest backup file is not same with last one." | |
else | |
rm $filename | |
#echo "The latest backup file is same with last one. Delete it." | |
fi | |
#echo "$filename md5:$md5 lmd5:$lmd5" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment