首页 > 代码库 > 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