Guest User

Untitled

a guest
Mar 5th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Creates database backups using mysqldump. It uses bzip2 for compression, and
  4. # the filename of the dump is DB- and the current timestamp. The dumps are stored
  5. # in ARCHIVE_DIR and bzip2 is called with nice to make it softer on the server.
  6.  
  7. ARCHIVE_DIR=~/backup
  8. FILENAME=`%Y-%m-%d_%H:%M:%S`
  9. USER=root
  10. PASS=your_db_password
  11. OPTIONS="-A -e"
  12.  
  13. mysqldump $OPTIONS -u $USER -p$PASS | nice bzip2 -9 > $ARCHIVE_DIR/DB-$FILENAME.sql.bz2
Add Comment
Please, Sign In to add comment