收藏文章 楼主

centos ubuntu 后台任务 nohup 软件

版块:linux   类型:普通   作者:小绿叶技术博客   查看:1330   回复:0   获赞:0   时间:2022-04-12 18:14:52
yum install coreutils -y                                   # centos 安装 nohup

apt install coreutils -y                                     # ubuntu 安装 nohup


nohup sh test.sh > /root/testsh.log 2>&1 &

# 后台运行


ps -ef | grep test.sh | grep -v grep

# 查看运行的任务


pid=`ps -ef | grep test.sh | grep -v grep| awk -F" " '{print $2}'`  && kill -9 $pid

关闭进程



systemd 系统进程编写,linux 开机启动服务编写 systemd 系统服务:http://eisc.cn/index.php?c=read&id=1051&page=1

提供企业建站服务,免费网防系统,提交信息登录 http://yundun.ddoss.cn 邮箱: proposal@ddoss.cn 
回复列表
默认   热门   正序   倒序

回复:centos ubuntu 后台任务 nohup 软件

头像

用户名:

粉丝数:

签名:

资料 关注 好友 消息