Created
May 23, 2018 18:08
-
-
Save msoranno/1ae9ffc5ea8da1d3944e958599ff39d4 to your computer and use it in GitHub Desktop.
mysql docker dump
This file contains hidden or 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/bash | |
| NOW=`date '+%Y%m%d%H%M%S'` | |
| dumpFile="Vector_$NOW.sql" | |
| echo | |
| echo "Se actualiza el repositorio" | |
| echo | |
| git pull | |
| echo | |
| echo "Creación del dump" | |
| echo | |
| cd dumps | |
| sudo docker exec mautic_sql_new sh -c 'exec mysqldump --databases mautic -uroot -p"$MYSQL_ROOT_PASSWORD" --ignore-table=mautic.users' > $dumpFile | |
| echo | |
| echo "Modificación de las tablas sobre el fichero" | |
| echo | |
| sed -i 's/vec_//g' $dumpFile | |
| echo | |
| echo "Modificación de las tablas sobre el fichero" | |
| echo | |
| git add . | |
| git commit -m "Backup de la bd de vector $dumpFile" | |
| git push | |
| cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment