Skip to content

Instantly share code, notes, and snippets.

@henriqueboaventura
Created December 13, 2012 16:09
Show Gist options
  • Save henriqueboaventura/4277494 to your computer and use it in GitHub Desktop.
Save henriqueboaventura/4277494 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo 'gerando o dump dos bancos';
mysqldump --all-databases -h 127.0.0.1 -u root > /tmp/dump.sql
echo 'compactando o dump';
NOW=$(date +"%Y_%m_%d");
zip "backup_db_$NOW.zip" /tmp/dump.sql
echo 'removendo arquivos temporários';
rm /tmp/dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment