Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Creates database backups using mysqldump. It uses bzip2 for compression, and
- # the filename of the dump is DB- and the current timestamp. The dumps are stored
- # in ARCHIVE_DIR and bzip2 is called with nice to make it softer on the server.
- ARCHIVE_DIR=~/backup
- FILENAME=`%Y-%m-%d_%H:%M:%S`
- USER=root
- PASS=your_db_password
- OPTIONS="-A -e"
- mysqldump $OPTIONS -u $USER -p$PASS | nice bzip2 -9 > $ARCHIVE_DIR/DB-$FILENAME.sql.bz2
Add Comment
Please, Sign In to add comment