-
-
Save johanneslamers/62c8d4ff9eb76e368fe41d63032fb7c7 to your computer and use it in GitHub Desktop.
Revisions
-
jstnkrr revised this gist
Oct 13, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,6 +28,7 @@ fi rm -fr $tmp_dir/* db_destination=db/`hostname`/ echo $db_destination s3cmd sync --recursive --preserve /var/lib/automysqlbackup/ s3://$BUCKET/$db_destination shopt -s dotglob -
jstnkrr revised this gist
Oct 13, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ fi rm -fr $tmp_dir/* db_destination=db/`hostname`/ s3cmd sync --recursive --preserve /var/lib/automysqlbackup/ s3://$BUCKET/$db_destination shopt -s dotglob -
jstnkrr revised this gist
Oct 13, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,8 @@ fi rm -fr $tmp_dir/* db_destination = db/`hostname`/ s3cmd sync --recursive --preserve /var/lib/automysqlbackup/ s3://$BUCKET/$db_destination shopt -s dotglob -
jstnkrr revised this gist
Oct 13, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,7 @@ fi rm -fr $tmp_dir/* s3cmd sync --recursive --preserve /var/lib/automysqlbackup/ s3://$BUCKET/db/`hostname`/ shopt -s dotglob -
jstnkrr revised this gist
Oct 13, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #!/bin/bash export BUCKET=filament-sp-backup date_daily=`date +"%Y-%m-%d"` tmp_dir=/tmp/sp-backup-$date_daily @@ -11,16 +11,16 @@ week_day=`date +"%u"` # On first month day do if [ "$month_day" -eq 1 ] ; then destination=$tmp_dir/monthly/`hostname`/$date_daily type="monthly" else # On saturdays do if [ "$week_day" -eq 6 ] ; then destination=$tmp_dir/weekly/`hostname`/$date_daily type="weekly" else # On any regular day do destination=$tmp_dir/daily/`hostname`/$date_daily type="daily" fi fi -
jstnkrr revised this gist
Sep 26, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #!/bin/bash export BUCKET=filament-sp-backup/`hostname` -
jstnkrr revised this gist
Sep 25, 2015 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,7 @@ find /srv/users/* -prune -type d | while read d; do app=$(basename "$e") # skip daily dev site backups if ([[ "$app" =~ ^(dev|staging|proto) ]] || [[ "$app" =~ (dev|staging|proto)$ ]]) && [[ "$type" == "daily" ]] ; then continue fi @@ -55,9 +55,9 @@ find /srv/users/* -prune -type d | while read d; do done done find /etc/apache-sp/vhosts.d/*.d/*.conf ! -name "main.conf" -exec tar -rvf $destination/sp-config.tar {} \; find /etc/nginx-sp/vhosts.d/*.d/*.conf ! -name "main.conf" -exec tar -rvf $destination/sp-config.tar {} \; find /etc/nginx-sp/ssl/ -type f -exec tar -rvf $destination/sp-config.tar {} \; s3cmd put --recursive $tmp_dir/* s3://$BUCKET/ -
jstnkrr revised this gist
Sep 25, 2015 . 1 changed file with 26 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ #/bin/bash export BUCKET=filament-sp-backup/`hostname` date_daily=`date +"%Y-%m-%d"` tmp_dir=/tmp/sp-backup-$date_daily @@ -11,29 +11,40 @@ week_day=`date +"%u"` # On first month day do if [ "$month_day" -eq 1 ] ; then destination=$tmp_dir/monthly/$date_daily type="monthly" else # On saturdays do if [ "$week_day" -eq 6 ] ; then destination=$tmp_dir/weekly/$date_daily type="weekly" else # On any regular day do destination=$tmp_dir/daily/$date_daily type="daily" fi fi rm -fr $tmp_dir/* s3cmd sync --recursive --preserve /var/lib/automysqlbackup/ s3://$BUCKET/db/ shopt -s dotglob find /srv/users/* -prune -type d | while read d; do user=$(basename "$d") find $d/apps/* -prune -type d | while read e; do app=$(basename "$e") # skip daily dev site backups if ([[ "$app" =~ ^(dev|staging) ]] || [[ "$app" =~ (dev|staging)$ ]]) && [[ "$type" == "daily" ]] ; then continue fi cd $d/apps mkdir -p $destination/$user/apps archive=$destination/$user/apps/$app.tgz @@ -44,7 +55,11 @@ find /srv/users/* -prune -type d | while read d; do done done find /etc/apache-sp/vhosts.d/*.d/*.conf ! -name "main.conf" -exec tar -rvf $tmp_dir/sp-config.tar {} \; find /etc/nginx-sp/vhosts.d/*.d/*.conf ! -name "main.conf" -exec tar -rvf $tmp_dir/sp-config.tar {} \; find /etc/nginx-sp/ssl/ -type f -exec tar -rvf $tmp_dir/sp-config.tar {} \; s3cmd put --recursive $tmp_dir/* s3://$BUCKET/ rm -fr $tmp_dir -
jstnkrr renamed this gist
Sep 25, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jstnkrr revised this gist
Sep 25, 2015 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -46,3 +46,5 @@ done s3cmd put --recursive $tmp_dir/* s3://$BUCKET/ rm -fr $tmp_dir -
jstnkrr created this gist
Sep 25, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ #/bin/bash export BUCKET=filament-sp-backup/counsel-toronto date_daily=`date +"%Y-%m-%d"` tmp_dir=/tmp/sp-backup-$date_daily # Get current month and week day number month_day=`date +"%d"` week_day=`date +"%u"` # On first month day do if [ "$month_day" -eq 1 ] ; then destination=$tmp_dir/monthly/$date_daily else # On saturdays do if [ "$week_day" -eq 6 ] ; then destination=$tmp_dir/weekly/$date_daily else # On any regular day do destination=$tmp_dir/daily/$date_daily fi fi rm -fr $destination/* s3cmd sync --recursive --preserve /var/lib/automysqlbackup/ s3://$BUCKET/db/ shopt -s dotglob find /srv/users/* -prune -type d | while read d; do user=$(basename "$d") find $d/apps/* -prune -type d | while read e; do app=$(basename "$e") cd $d/apps mkdir -p $destination/$user/apps archive=$destination/$user/apps/$app.tgz echo "$e => $archive" tar cvzfp $archive $e done done s3cmd put --recursive $tmp_dir/* s3://$BUCKET/