Advertisement
Guest User

Untitled

a guest
May 31st, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. # Shell script to backup the affiliate production database and push it to an off-site server
  3.  
  4. CURRENTDATE = $(date +"%Y_%m_%d-%H_%M")
  5. USER        = "production"
  6. PASSWORD    = "mypass"
  7. DATABASE    = "mydb"
  8. SAVEDIR     = "/backup"
  9. BACKUPFILE  = "$DATABASE_prod_$CURRENTDATE.sql"
  10.  
  11. # backup the database
  12. mysqldump -c -e -n -t -p --user=$USER --password=$PASSWORD --default-character-set=utf8 DATABASE > $SAVEDIR/$BACKUPFILE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement