zoukankan      html  css  js  c++  java
  • nohup 测试记录


    终端操作

    一、java HelloJava

    1. ctrl+C 进程关闭

    2. 手动关闭终端 进程关闭

    3. exec.sh
    #!/bin/bash
    cd /home/wlanuser/z07732
    java HelloJava

    ./exec.sh ctrl+C 进程关闭
    ./exec.sh 手动关闭终端 进程关闭
    nohup sh exec.sh ctrl+C 进程关闭
    nohup sh exec.sh 手动关闭终端 进程不关闭
    nohup sh exec.sh & exit退出终端进程不关闭
    nohup sh exec.sh & 手动关闭终端,进程不关闭

    二、java HelloJava &

    1. 手动关闭终端 进程关闭

    2. 手敲exit命令退出终端 进程不关闭

    3. exec.sh
    [root@master z07732]# cat exec.sh
    #!/bin/bash
    cd /home/wlanuser/z07732
    java HelloJava &

    ./exec.sh 手动关闭终端,进程不关闭
    ./exec.sh exit命令退出终端,进程不关闭
    nohup sh exec.sh exit命令退出终端,进程不关闭
    nohup sh exec.sh 手动关闭终端 进程不关闭
    nohup sh exec.sh & exit退出终端进程不关闭
    nohup sh exec.sh & 手动关闭终端,进程不关闭

    4. exec.sh
    [root@master z07732]# more exec.sh
    #!/bin/bash
    cd /home/wlanuser/z07732
    java HelloJava &
    exit 0

    ./exec.sh 手动关闭终端,进程不关闭
    ./exec.sh exit命令退出终端,进程不关闭
    nohup sh exec.sh exit命令退出终端,进程不关闭
    nohup sh exec.sh 手动关闭终端 进程不关闭
    nohup sh exec.sh & exit退出终端,进程不关闭
    nohup sh exec.sh & 手动关闭终端,进程不关闭

    三、nohup java HelloJava

    1. 手动关闭终端,进程不关闭
    2. ctrl+C 进程关闭

    3. ./exec.sh

    [root@master z07732]# cat exec.sh
    #!/bin/bash
    cd /home/wlanuser/z07732
    nohup java HelloJava

    ./exec.sh ctrl+C 进程关闭
    ./exec.sh 手动关闭终端,进程不关闭
    nohup sh exec.sh ctrl+C 进程关闭
    nohup sh exec.sh 手动关闭终端 进程不关闭
    nohup sh exec.sh & exit退出终端,进程不关闭
    nohup sh exec.sh & 手动关闭终端,进程不关闭

    [root@master z07732]# cat exec.sh ------------------这个脚本应该 上面的是一样的,会挂在nohup这行走不到exit
    #!/bin/bash
    cd /home/wlanuser/z07732
    nohup java HelloJava
    exit 0

    ./exec.sh ctrl+C 进程关闭
    ./exec.sh 手动关闭终端,进程不关闭
    nohup sh exec.sh ctrl+C 进程关闭
    nohup sh exec.sh 手动关闭终端 进程不关闭
    nohup sh exec.sh & exit退出终端,进程不关闭
    nohup sh exec.sh & 手动关闭终端,进程不关闭

    四、nohup java HelloJava &
    1. 手动关闭终端,进程不关闭
    2. exit命令退出终端,进程不关闭

    3. ./exec.sh
    [root@master z07732]# cat exec.sh
    #!/bin/bash
    cd /home/wlanuser/z07732
    nohup java HelloJava &

    ./exec.sh 手动关闭终端,进程不关闭
    ./exec.sh exit命令退出终端,进程不关闭
    nohup sh exec.sh exit退出终端,进程不关闭
    nohup sh exec.sh 手动关闭终端 进程不关闭
    nohup sh exec.sh & exit退出终端,进程不关闭
    nohup sh exec.sh & 手动关闭终端,进程不关闭

    [root@master z07732]# cat exec.sh
    #!/bin/bash
    cd /home/wlanuser/z07732
    nohup java HelloJava &
    exit 0

    ./exec.sh 手动关闭终端,进程不关闭
    ./exec.sh exit命令退出终端,进程不关闭

    API
    一、
    [root@node2 mongo-hive-hbase]# cat Hive_HistClientsInfoAnalysis_temp.sh
    #!/bin/bash

    nohup hive -S -e "select a.acSN,date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2),count(a.clientMAC) from (select acSN,clientMAC from hbase_testtable0801 where to_date(uplineDate)=date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acSN,clientMAC) a group by a.acSN;" &


    nohup hive -S -e "select sub1.acsn, date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2),count(sub1.clientMac) as addClientCounts from (select acsn,clientMAC from hbase_testtable0801 where to_date(uplinedate)=date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acsn,clientmac) sub1 left join (select acsn,clientmac from hbase_testtable0801 where to_date(uplinedate) < date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acsn, clientmac) sub2 on (sub1.acsn = sub2.acsn and sub1.clientMAC = sub2.clientMAC) where sub2.clientMAC is NULL group by sub1.acsn;" &

    cd /home/mongo-hive-hbase/; sh Hive_HistClientsInfoAnalysis_temp.sh 代码里不sleep就关闭连接,会导致Hive任务没执行
    cd /home/mongo-hive-hbase/; nohup sh Hive_HistClientsInfoAnalysis_temp.sh 代码里不sleep就关闭连接,会导致Hive任务没执行
    cd /home/mongo-hive-hbase/; nohup sh Hive_HistClientsInfoAnalysis_temp.sh & 代码里不sleep就关闭连接,会导致Hive任务没执行

    二、

    [root@node2 mongo-hive-hbase]# more Hive_HistClientsInfoAnalysis_temp.sh
    #!/bin/bash

    hive -S -e "select a.acSN,date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2),count(a.clientMAC) from (select acSN,clientMAC from hbase_testtable0801 where to_date(upline
    Date)=date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acSN,clientMAC) a group by a.acSN;" &


    hive -S -e "select sub1.acsn, date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2),count(sub1.clientMac) as addClientCounts from (select acsn,clientMAC from hbase_testtabl
    e0801 where to_date(uplinedate)=date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acsn,clientmac) sub1 left join (select acsn,clientmac from hbase_testtable080
    1 where to_date(uplinedate) < date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acsn, clientmac) sub2 on (sub1.acsn = sub2.acsn and sub1.clientMAC = sub2.clien
    tMAC) where sub2.clientMAC is NULL group by sub1.acsn;" &


    cd /home/mongo-hive-hbase/; sh Hive_HistClientsInfoAnalysis_temp.sh 代码里不sleep就关闭连接,会导致Hive任务没执行
    cd /home/mongo-hive-hbase/; nohup sh Hive_HistClientsInfoAnalysis_temp.sh 代码里不sleep就关闭连接,会导致Hive任务没执行
    cd /home/mongo-hive-hbase/; nohup sh Hive_HistClientsInfoAnalysis_temp.sh & 代码里不sleep就关闭连接,会导致Hive任务没执行


    三、sleep
    [root@node2 mongo-hive-hbase]# cat Hive_HistClientsInfoAnalysis_temp.sh
    #!/bin/bash

    hive -S -e "select a.acSN,date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2),count(a.clientMAC) from (select acSN,clientMAC from hbase_testtable0801 where to_date(uplineDate)=date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acSN,clientMAC) a group by a.acSN;" &

    hive -S -e "select sub1.acsn, date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2),count(sub1.clientMac) as addClientCounts from (select acsn,clientMAC from hbase_testtable0801 where to_date(uplinedate)=date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acsn,clientmac) sub1 left join (select acsn,clientmac from hbase_testtable0801 where to_date(uplinedate) < date_sub(to_date(from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss')),2) group by acsn, clientmac) sub2 on (sub1.acsn = sub2.acsn and sub1.clientMAC = sub2.clientMAC) where sub2.clientMAC is NULL group by sub1.acsn;" &

    sleep 60

    cd /home/mongo-hive-hbase/; sh Hive_HistClientsInfoAnalysis_temp.sh 代码里不sleep就关闭连接,会导致Hive任务没执行
    cd /home/mongo-hive-hbase/; nohup sh Hive_HistClientsInfoAnalysis_temp.sh 代码里不sleep就关闭连接,会导致Hive任务没执行
    cd /home/mongo-hive-hbase/; nohup sh Hive_HistClientsInfoAnalysis_temp.sh & 代码里不sleep就关闭连接,会导致Hive任务没执行

  • 相关阅读:
    人脸识别总结(附开源项目代码与各大数据集下载路径)
    simpledet 的配置
    论文笔记--PCN:Real-Time Rotation-Invariant Face Detection with Progressive Calibration Networks
    smallcorgi/Faster-RCNN_TF训练自己的数据
    保存文件名至txt文件中,不含后缀
    训练 smallcorgi/Faster-RCNN_TF 模型(附ImageNet model百度云下载地址)
    调试 smallcorgi/Faster-RCNN_TF 的demo过程遇到的问题
    python字符串前缀和格式化
    摩斯电码与字母相互转换
    django配置mysql
  • 原文地址:https://www.cnblogs.com/zhengchunhao/p/5849385.html
Copyright © 2011-2022 走看看