Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
2d1484cd
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2d1484cd
编写于
8月 01, 2019
作者:
H
huili
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[no remove config, data, log files]
上级
a73f138a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
8 addition
and
60 deletion
+8
-60
packaging/tools/makepkg.sh
packaging/tools/makepkg.sh
+2
-2
packaging/tools/remove.sh
packaging/tools/remove.sh
+6
-58
未找到文件。
packaging/tools/makepkg.sh
浏览文件 @
2d1484cd
packaging/tools/remove.sh
浏览文件 @
2d1484cd
#!/bin/bash
#
# Script to stop the service and uninstall
TSDB
# Script to stop the service and uninstall
tdengine, but retain the config, data and log files.
RED
=
'\033[0;31m'
GREEN
=
'\033[1;32m'
NC
=
'\033[0m'
data_dir
=
"/var/lib/taos"
log_dir
=
"/var/log/taos"
#install main path
install_main_dir
=
"/usr/local/taos"
data_link_dir
=
"/usr/local/taos/data"
log_link_dir
=
"/usr/local/taos/log"
cfg_link_dir
=
"/usr/local/taos/cfg"
bin_link_dir
=
"/usr/bin"
lib_link_dir
=
"/usr/lib"
inc_link_dir
=
"/usr/include"
header_dir
=
"/usr/local/include/taos"
cfg_dir
=
"/etc/taos"
bin_dir
=
"/usr/local/bin/taos"
lib_dir
=
"/usr/local/lib/taos"
link_dir
=
"/usr/bin"
service_config_dir
=
"/etc/systemd/system"
taos_service_name
=
"taosd"
nginx_service_name
=
"tdnginx"
csudo
=
""
if
command
-v
sudo
>
/dev/null
;
then
...
...
@@ -52,41 +41,26 @@ function clean_bin() {
${
csudo
}
rm
-f
${
bin_link_dir
}
/taosd
||
:
${
csudo
}
rm
-f
${
bin_link_dir
}
/taosdump
||
:
${
csudo
}
rm
-f
${
bin_link_dir
}
/rmtaos
||
:
# Remove binary files
#${csudo} rm -rf ${bin_dir} || :
}
function
clean_lib
()
{
# Remove link
${
csudo
}
rm
-f
${
lib_link_dir
}
/libtaos.
*
||
:
#${csudo} rm -f /usr/lib/libtaos.so || :
#${csudo} rm -rf ${lib_dir} || :
}
function
clean_header
()
{
# Remove link
${
csudo
}
rm
-f
${
inc_link_dir
}
/taos.h
||
:
#${csudo} rm -rf ${header_dir}
}
function
clean_config
()
{
# Remove link
${
csudo
}
rm
-f
${
cfg_link_dir
}
/
*
||
:
#${csudo} rm -rf ${cfg_link_dir} || :
}
function
clean_log
()
{
if
grep
-e
'^\s*logDir.*$'
${
cfg_dir
}
/taos.cfg &> /dev/null
;
then
config_log_dir
=
$(
cut
-d
' '
-f2
<<<
$(
grep
-e
'^\s*logDir.*$'
${
cfg_dir
}
/taos.cfg
))
# echo "Removing log dir ${config_log_dir}......"
${
csudo
}
rm
-rf
${
config_log_dir
}
||
:
fi
# Remove link
${
csudo
}
rm
-rf
${
log_link_dir
}
||
:
${
csudo
}
rm
-rf
${
log_dir
}
||
:
}
function
clean_service_on_systemd
()
{
...
...
@@ -123,16 +97,6 @@ function clean_service() {
fi
}
isAll
=
"true"
if
!
type
taosd &> /dev/null
;
then
isAll
=
"false"
fi
config_data_dir
=
''
if
grep
-e
'^\s*dataDir.*$'
${
cfg_dir
}
/taos.cfg &> /dev/null
;
then
config_data_dir
=
$(
cut
-d
' '
-f2
<<<
$(
grep
-e
'^\s*dataDir.*$'
${
cfg_dir
}
/taos.cfg
))
fi
# Stop service and disable booting start.
clean_service
# Remove binary file and links
...
...
@@ -141,29 +105,13 @@ clean_bin
clean_header
# Remove lib file
clean_lib
# Remove log directory
# Remove l
ink l
og directory
clean_log
# Remove configuration file
# Remove
link
configuration file
clean_config
# Remove data directory
# Remove data
link
directory
${
csudo
}
rm
-rf
${
data_link_dir
}
||
:
[
"
$isAll
"
=
"false"
]
&&
exit
0
||
:
echo
-e
-n
"
${
RED
}
Do you want to delete data stored in TDengine? [y/N]:
${
NC
}
"
read
is_delete
while
true
;
do
if
[
"
${
is_delete
}
"
=
"y"
]
||
[
"
${
is_delete
}
"
=
"Y"
]
;
then
${
csudo
}
rm
-rf
${
data_dir
}
# echo "Removing data file ${config_data_dir}..."
[
-n
${
config_data_dir
}
]
&&
${
csudo
}
rm
-rf
${
config_data_dir
}
break
elif
[
"
${
is_delete
}
"
=
"n"
]
||
[
"
${
is_delete
}
"
=
"N"
]
;
then
break
else
read
-p
"Please enter 'y' or 'n': "
is_delete
fi
done
${
csudo
}
rm
-rf
${
install_main_dir
}
osinfo
=
$(
awk
-F
=
'/^NAME/{print $2}'
/etc/os-release
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录