remote-access
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRemote Access with Acquia CLI
使用Acquia CLI进行远程访问
Use when:
- Opening an SSH shell on a Cloud environment
- Running a Drush command on a remote environment
- Downloading or listing Drush aliases
- Tailing live logs from an environment
适用于以下场景:
- 在云平台环境中打开SSH shell
- 在远程环境中运行Drush命令
- 下载或列出Drush别名
- 实时查看环境日志
SSH into a Cloud Environment
连接到云环境的SSH
Open an interactive shell in a Cloud Platform environment:
bash
acli remote:ssh <alias>Alias:
acli sshThe alias format is (e.g. , ).
app-name.envmyapp.prodmyapp.devbash
undefined在云平台环境中打开交互式shell:
bash
acli remote:ssh <alias>别名:
acli ssh别名格式为(例如、)。
app-name.envmyapp.prodmyapp.devbash
undefinedOpen interactive shell
打开交互式shell
acli remote:ssh myapp.prod
acli remote:ssh myapp.prod
Run a single command without opening a shell
不打开shell直接执行单个命令
acli remote:ssh myapp.prod -- ls -la /var/www/html
acli remote:ssh myapp.prod -- ls -la /var/www/html
Run multiple commands
执行多个命令
acli remote:ssh myapp.prod -- "cd /var/www/html && git log --oneline -5"
---acli remote:ssh myapp.prod -- "cd /var/www/html && git log --oneline -5"
---Run Drush Remotely
远程运行Drush命令
Run any Drush command on a Cloud environment without SSHing in manually:
bash
acli remote:drush <drush_command>Aliases: ,
acli drushacli drbash
undefined无需手动SSH连接,即可在云环境中运行任意Drush命令:
bash
acli remote:drush <drush_command>别名:、
acli drushacli drbash
undefinedCheck Drupal status
检查Drupal状态
acli remote:drush status
acli remote:drush status
Clear caches
清除缓存
acli remote:drush cr
acli remote:drush cr
Run database updates
运行数据库更新
acli remote:drush updatedb
acli remote:drush updatedb
Export configuration
导出配置
acli remote:drush cex
---acli remote:drush cex
---Tail Logs Live
实时查看日志
Stream live logs from an environment:
bash
acli app:log:tailAliases: ,
acli tailacli log:tailPrompts you to select the application, environment, and log type.
流式查看环境的实时日志:
bash
acli app:log:tail别名:、
acli tailacli log:tail会提示您选择应用、环境和日志类型。
List Drush Aliases
列出Drush别名
List all Drush site aliases for your Cloud environments:
bash
acli remote:aliases:listAliases: ,
acli aliasesacli sa列出您所有云环境的Drush站点别名:
bash
acli remote:aliases:list别名:、
acli aliasesacli saDownload Drush Aliases
下载Drush别名
Download Drush aliases for use with local Drush:
bash
acli remote:aliases:downloadOptions:
bash
acli remote:aliases:download \
--destination-dir=/path/to/aliases \
--all # download aliases for all applications下载Drush别名以供本地Drush使用:
bash
acli remote:aliases:download选项:
bash
acli remote:aliases:download \
--destination-dir=/path/to/aliases \
--all # 下载所有应用的别名Best Practices
最佳实践
- Use over SSH for Drush commands — It handles authentication and environment selection automatically.
remote:drush - Use aliases — Download aliases with so local Drush can target Cloud environments directly.
remote:aliases:download - Tail logs during deploys — Run while deploying to catch errors in real time.
acli app:log:tail
- 优先使用而非SSH执行Drush命令——它会自动处理身份验证和环境选择。
remote:drush - 使用别名——通过下载别名,以便本地Drush可以直接指向云环境。
remote:aliases:download - 部署期间实时查看日志——部署时运行以实时捕获错误。
acli app:log:tail
Related Topics
相关主题
- Pull & Push — Sync code, files, and databases
- SSH Key Management — Secure access setup
- Environment Management — Manage environments
- 拉取与推送 —— 同步代码、文件和数据库
- SSH密钥管理 —— 安全访问设置
- 环境管理 —— 管理环境