SHARE
TWEET

Untitled

a guest May 31st, 2017 83 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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top