• shell 脚本记录


    shell脚本中执行另一个shell脚本

    可以在一个shell脚本中执行另一个shell脚本(或非可执行文件,主要用于取得一些变量的值),方法是:
    . 文件名(包括路径)
    变量=文件名(包括路径)
    . $变量
     
    注意,圆点后面有个空格。
    这样,在本shell脚本的后面部分就可以引用其他文件中声明的一些变量。
     

    linux手动添加开机启动的服务

    执行下cat /etc/rc.local看看这个文件,不需要任何帮助手册和文档,看完这个文件后你就有更好的办法来添加一个开机启动的服务。

    #!/bin/sh -e
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.

    . /var/www/sphinx/restart.sh

    exit 0

    Crontab 

    # 全文检索
    30 1 * * * /bin/sh /var/www/sphinx/sphinx.sh;

    # 聊天室在线用户检查脚本
    */1 * * * * php /var/www/ccccccc/_TOOLS/update_online_users.php

    linux if

    # pimei

    site=1
    if [ $site = 1 ]
    then
    /usr/local/coreseek/bin/indexer --config /var/www/sphinx/www.site.com/pre_portal_article_title/pre_portal_article_title.conf --all
    /usr/local/coreseek/bin/searchd -c /var/www/sphinx/www.site.com/pre_portal_article_title/pre_portal_article_title.conf
    /usr/local/coreseek/bin/indexer --config /var/www/sphinx/www.site.com/pre_portal_article_and_tag/pre_portal_article_and_tag.conf --all
    /usr/local/coreseek/bin/searchd -c /var/www/sphinx/www.site.com/pre_portal_article_and_tag/pre_portal_article_and_tag.conf
    fi

  • 相关阅读:
    2019.1.4函数的相关内容
    2019.1.3 序列常见的BIF
    2019.1.2字符串格式化的内容
    2018.12.29字符串的相关内容
    2018.12.28字符串的相关内容
    2018.12.27上午学习内容
    下午的学习内容
    今天上午学习的内容
    四、自动装配
    lombok
  • 原文地址:https://www.cnblogs.com/bandbandme/p/3924162.html
Copyright © 2020-2023  润新知