-
-
Save antonioaguilar/0abbc6e0d7e8cdf836e120fbddac14e2 to your computer and use it in GitHub Desktop.
Revisions
-
lucaswilric revised this gist
Nov 24, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,9 +5,9 @@ # NOT RECOMMENDED FOR LARGE DATABASES! # Dump a MySQL database # Read this for how to get your password into mysqldump: # https://dev.mysql.com/doc/refman/5.1/en/password-security-user.html mysqldump -u username > database.sql # Or dump a PostgreSQL database. For this one, you'll need to put your credentials # in ~/.pgpass in this format: -
lucaswilric revised this gist
Nov 24, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,8 @@ # NOT RECOMMENDED FOR LARGE DATABASES! # Dump a MySQL database # Don't put your password in here for real. Read this instead: # https://dev.mysql.com/doc/refman/5.1/en/password-security-user.html mysqldump -u username --password=this_is_a_lame_password database > database.sql # Or dump a PostgreSQL database. For this one, you'll need to put your credentials @@ -18,7 +20,7 @@ pg_dump --host=localhost --username=username database > database.sql gzip -N -9 database.sql # Encrypt openssl enc -aes-256-cbc -in database.sql.gz -out database.sql.gz.aes256cbc -pass file:db_encryption.pass # Store mv database.sql.gz.aes256cbc /home/user/Dropbox/db-backups/`date +%Y%m%d%H%M%S`_database.sql.gz.aes256cbc -
lucaswilric revised this gist
Nov 24, 2012 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,8 @@ #!/bin/bash # This script dumps a database to SQL, compresses, encrypts and timestamps it, then saves it to Dropbox. Ideal for a cronjob. # It uses symmetric encryption, so guard your password carefully. # # NOT RECOMMENDED FOR LARGE DATABASES! # Dump a MySQL database mysqldump -u username --password=this_is_a_lame_password database > database.sql -
lucaswilric revised this gist
Nov 24, 2012 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,6 @@ #!/bin/bash # This script dumps a database to SQL, compresses, encrypts and timestamps it, then saves it to Dropbox. Ideal for a cronjob. # It uses symmetric encryption, so guard your password carefully! # Dump a MySQL database mysqldump -u username --password=this_is_a_lame_password database > database.sql @@ -10,14 +12,14 @@ mysqldump -u username --password=this_is_a_lame_password database > database.sql # pg_dump --host=localhost --username=username database > database.sql # Compress: -9 means best, slowest encryption. gzip -N -9 database.sql # Encrypt openssl enc -aes-256-cbc -in database.sql.gz -out database.sql.gz.aes256cbc -pass pass:another_lame_password # Store mv database.sql.gz.aes256cbc /home/user/Dropbox/db-backups/`date +%Y%m%d%H%M%S`_database.sql.gz.aes256cbc # Clean up rm database.sql.gz -
lucaswilric created this gist
Nov 24, 2012 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #!/bin/bash # Dump a MySQL database mysqldump -u username --password=this_is_a_lame_password database > database.sql # Or dump a PostgreSQL database. For this one, you'll need to put your credentials # in ~/.pgpass in this format: # # hostname:port:database:username:password # pg_dump --host=localhost --username=username database > database.sql # Compress gzip -N -9 database.sql # Encrypt openssl enc -aes-256-cbc -in database.sql.gz -out database.sql.gz.aes256cbc -pass pass:another_lame_password # Store mv database.sql.gz.aes256cbc /home/lucas/Dropbox/db-backups/`date +%Y%m%d%H%M%S`_database.sql.gz.aes256cbc # Clean up rm database.sql.gz