Last active
March 18, 2017 14:39
-
-
Save acacha/b2cbe3a8508a375ebf34 to your computer and use it in GitHub Desktop.
Mysql Backup
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 | |
#CÒPIA DE SEGURETAT BASE DE DADES MEDIAWIKI | |
# First clean files older than 20 days: http://acacha.org/mediawiki/index.php/Tmpwatch | |
tmpreaper --verbose 20d /linux2/backups/mysql | |
inici=`date` | |
dia=`date "+%Y%m%d"` | |
mysql_backups_folder="/linux2/backups/mysql" | |
echo "##################################################################################" | |
echo "Executant còpia de base de dades (mysqldump) de mediawiki. Inici: $inici" | |
echo "##################################################################################" | |
echo "Time:" | |
time mysqldump --user=backups --password=PASSWORD wikidb > $mysql_backups_folder/wikidb_$dia.sql | |
final=`date` | |
echo "##################################################################################" | |
echo "Acabada la còpia de seguretat. Final: $final" | |
echo "##################################################################################" | |
echo "" | |
# http://acacha.org | |
# Sergi Tur Badenas | |
# CÒPIA DE SEGURETAT BASE DE DADES MOODLE | |
inici=`date` | |
echo "##################################################################################" | |
echo "Executant còpia de base de dades (mysqldump) de moodle. Inici: $inici" | |
echo "##################################################################################" | |
echo "Time:" | |
time mysqldump --user=backups --password=PASSWORD moodle > $mysql_backups_folder/moodle_$dia.sql | |
final=`date` | |
echo "##################################################################################" | |
echo "Acabada la còpia de seguretat. Final: $final" | |
echo "##################################################################################" | |
echo "" | |
echo "Carpeta $mysql_backups_folder:" | |
ls -lah $mysql_backups_folder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment