Execute arbitrary commands on AWS boxes using SSH.
Exec example:
α> cp awsm-exec.sh ~/.awsm/plugins
To setup awsm-exec to use sudo for executing commands add the following to ~/.awsm/config
.
AWSM_EXEC_SUDO_USER=user_name
α> awsm exec 'ps aux | grep unicorn'
α> awsm exec top
Create a session with a single instance. All exec
commands will be sent to that instance.
α> awsm session
α> awsm exec ls -la /var/log/application.log # commands executed directly against the selected instance
α> awsm exec tail -f /var/log/application.log
α> awsm session clear
To make things easier create a local .awsm-profile
file and add AWSM_APP_DEPLOY_DIR=/path/to/app
. From now on you can run the following and the command will be executed in the dir specified in the .awsm-profile
file.
α> awsm app_exec ls -la # Executes ls -la in the direct specified by AWSM_APP_DEPLOY_DIR in the local .awsm-profile
α> awsm diskspace # Executes df -h
α> awsm memory # Executes vmstat
Executes rails commands on the instance selected. Note: You may need to setup the sudo user (as described above) in your config file.
The path to the directory the app lives in must be specified.
α> awsm rails c /path/to/app # Executes rails console in the director specified.
α> awsm rails c # If there is a local .awsm-profile file with AWSM_APP_DEPLOY_DIR set, then the app path does not need to be specified.
α> awsm rails db /path/to/app # Executes rails console in the director specified.