Last active
          August 29, 2015 14:18 
        
      - 
      
- 
        Save CodeBrauer/02d40ca8decf97eeb823 to your computer and use it in GitHub Desktop. 
    super simple mysql backup script with mysqldump
  
        
  
    
      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 | |
| cd /_backups | |
| HOST="1.2.3.4" | |
| USER="my_backup_user" | |
| PASS="**************" | |
| DATE_TODAY=$(date +"%Y-%m-%d") | |
| # dump it | |
| mysqldump -h $HOST -u $USER -p$PASS --all-databases > db_$DATE_TODAY.sql | |
| # compress! | |
| gzip -9 -f db_$DATE_TODAY.sql | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment