上一主题: dpmrpt schedulereport 命令-排定报告下一主题: 帮助中心命令


dpmssh run 命令-运行远程外壳命令或脚本

dpmssh run 命令允许使用安全套接字外壳 (SSH) 在目标 Linux 或 UNIX 系统上远程登录并执行外壳命令或脚本以进行安全通信。

此命令具有以下格式:

dpmssh run -cmdline commandline -target_host targethostname -target_user targetusername -target_password targetpassword [-pre] [-post] 
-cmdline commandline

定义要运行的脚本文件所在的 Shell 命令或路径。

-target_host targethostname

定义目标 Linux 或 UNIX 主机服务器的名称。

-target_user targetusername

定义目标 Linux 或 UNIX 主机服务器的用户名。

-target_password targetpassword

指定目标 Linux 或 UNIX 主机服务器的用户密码。

-pre

(可选)指定是否在执行操作之前生成事件。

-post

(可选)指定是否在执行操作之后生成事件。

示例:运行外壳命令并创建事件

本示例针对 /tmp 目录运行 ls 命令。

dpmssh run -cmdline "ls /tmp" -target_host linuxserver -target_user myusername -target_password pswd -pre -post

示例:运行远程脚本

本示例运行名为 MyScript 的脚本。

dpmssh run -cmdline "/tmp/MyScript.sh" -target_host unixbox -target_user root -target_password pass1