zoukankan      html  css  js  c++  java
  • rex 检查脚本执行的返回结果

    task "prepare01", "192.168.137.3", sub {
       file "/home/mqm/xbin/test.sh",
       source => "/root/Rex/test.sh",
       mode => 755,  
       owner  => "mqm",  
       group => "mqm";
       my $output = run "/home/mqm/xbin/test.sh";  
       print "--------------------------------
    ";
       say $?;
       print "--------------------------------
    ";
       say $output;  
    
    
    $VAR1 = {
              'auto_die' => undef
            };
    /home/mqm/xbin/test.sh: Command not found.error--------------------------------
    127
    --------------------------------
    
    127 失败
    
    
    正常情况:
    
    [root@node01 Rex]# rex prepare01
    [2017-10-22 22:55:38] WARN - Please use only the following characters for task names:
    [2017-10-22 22:55:38] WARN -   A-Z, a-z, 0-9 and _
    [2017-10-22 22:55:38] WARN - Also the task should start with A-Z or a-z
    [2017-10-22 22:55:38] WARN - You can disable this warning by setting feature flag: disable_taskname_warning
    [2017-10-22 22:55:38] INFO - Running task prepare01 on 192.168.137.3
    ddad2313
    $VAR1 = {
              'auto_die' => undef
            };
    --------------------------------
    0
    --------------------------------
    QMNAME(test)                                              STATUS(Ended immediately)
    [2017-10-22 22:55:40] INFO - All tasks successful on all hosts

  • 相关阅读:
    oracle数据库数据导出
    oracle 数据连接方式
    plsql 建表空间
    java Excel 导入数据库
    python爬虫学习数据分析(连载中)
    python之pip库管理工具pip安装
    数据结构之看病排队系统
    数据结构之顺序串
    数据结构之链队
    数据结构之环形队列
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13349452.html
Copyright © 2011-2022 走看看