Advertisement
Guest User

Untitled

a guest
Mar 15th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.73 KB | None | 0 0
  1. #!/bin/bash
  2. #Purpose = Backup of Recording Module DB
  3. #Created on 3-14-2017
  4. #Author = Brandon Shutter
  5. #Version 1.0
  6. #START
  7. TIME=`date +%b-%d-%y`
  8. FILENAME=backup-$TIME.tar.gz
  9.  
  10. DESDIR=/home/shutter/BackupDirectory/endpointsmoduledb/
  11. S3BUCKET='s3://elementvoip/netsapiensbackup/'$HOSTNAME'/endpointsmoduledb/'
  12.  
  13. # Database credentials
  14.  user="root"
  15.  password="sipbx"
  16.  host="localhost"
  17.  db_name="LiCfDomain"
  18. # Set default file permissions
  19.  umask 177
  20. # Dump database into SQL file
  21. mysqldump --user=$user --password=$password --host=$host $db_name --skip-add-drop-table --no-create-info > $DESDIR/$db_name-$TIME.sql
  22. DBFILE=$DESDIR/$db_name-$TIME.sql
  23. tar -cpzf $DESDIR/$FILENAME $DBFILE
  24. cd $DESDIR && aws s3 cp $FILENAME $S3BUCKET
  25. #END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement