Last active
December 30, 2015 20:49
-
-
Save joshkoenig/7883221 to your computer and use it in GitHub Desktop.
Terminus log fetching pseudocode.
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 characters
| <?php | |
| # Get the list of application endpoints and binding IDs | |
| # https://github.com/pantheon-systems/terminus/blob/master/terminus.site.api.inc#L265 | |
| $bindings = terminus_api_site_environment_bindings($site_uuid, $env, 'appserver'); | |
| foreach ($bindings as $bid => $binding) { | |
| $host = $binding->host; | |
| # Now grab them all with SFTP. | |
| # This assumes you have a ssh key with no pass, or a running ssh agent. | |
| passthru("echo 'get logs/nginx-access.log nginx-$bid.log'|sftp -o Port=2222 -b - $env.$site_uuid@$host"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment