Skip to content

Commit

Permalink
initial backup script commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedevita committed Oct 30, 2014
0 parents commit a57290b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
BUCKET="somebucket.com"
DBNAME="somedatabase"

tar -zcvf /tmp/os.$BUCKET.tar.gz /etc/passwd /etc/fstab /etc/hosts /etc/group /etc/apache2 /etc/mysql/my.cnf /var/www/$BUCKET && s3cmd put /tmp/os.$BUCKET.tar.gz s3://$BUCKET && rm /tmp/os.$BUCKET.tar.gz;
mysqldump --defaults-extra-file=/opt/backup-script/database.cnf $DBNAME > /tmp/$DBNAME.sql && tar -zcvf /tmp/db.$BUCKET.tar.gz /tmp/$DBNAME.sql && s3cmd put /tmp/db.$BUCKET.tar.gz s3://$BUCKET && rm /tmp/db.$BUCKET.tar.gz;
3 changes: 3 additions & 0 deletions database.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[mysqldump]
user=backup
password=somepassword

0 comments on commit a57290b

Please sign in to comment.