Skip to content

Instantly share code, notes, and snippets.

@biswajeetparida
Created September 23, 2020 09:14
Show Gist options
  • Save biswajeetparida/b596d2adde8a7f8ce8931f4ebf3a0f8d to your computer and use it in GitHub Desktop.
Save biswajeetparida/b596d2adde8a7f8ce8931f4ebf3a0f8d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Site UUID from Dashboard URL, eg 12345678-1234-1234-abcd-0123456789ab
SITE_UUID=xxxxxxxxxxx
ENV=live
for app_server in `dig +short -4 appserver.$ENV.$SITE_UUID.drush.in`;
do
rsync -rlvz --size-only --ipv4 --progress -e 'ssh -p 2222' $ENV.$SITE_UUID@$app_server:logs/* app_server_$app_server
done
# Include MySQL logs
for db_server in `dig +short -4 dbserver.$ENV.$SITE_UUID.drush.in`;
do
rsync -rlvz --size-only --ipv4 --progress -e 'ssh -p 2222' $ENV.$SITE_UUID@$db_server:logs/* db_server_$db_server
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment