daily pastebin goal
9%
SHARE
TWEET

Untitled

a guest Sep 19th, 2016 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. NOW=$(date +"%Y-%m-%d-%H%M")
  4.  
  5. DB_USER=""
  6. DB_PASS=""
  7. DB_NAME=""
  8. DB_HOST=""
  9.  
  10. TREE_FILE="$NOW.tar.gz"
  11. DB_FILE="$DB_NAME.$NOW.sql.tar.gz"
  12.  
  13. BACKUP_DIR="$NOW"
  14. WWW_DIR=""
  15.  
  16. mkdir -p $BACKUP_DIR
  17. tar -czvf $BACKUP_DIR/$TREE_FILE $WWW_DIR
  18.  
  19. mysqldump -h$DB_HOST -u$DB_USER -p$DB_PASS $DB_NAME > /tmp/$DB_NAME
  20. tar -czvf $BACKUP_DIR/$DB_FILE /tmp/$DB_NAME
  21. rm /tmp/$DB_NAME
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