# ems_backend

后端

```bash
cd /home/lichang/ems_backend
go mod download
cd restagent/
# 打包命名 omcDevApp
go build -ldflags="-s -w" -o omcDevApp

# 启动
./omcDevApp -c dev.yaml

nohup ./omcDevApp -c ./dev.yaml > ./dev.log 2>&1 &

# 查找进程并杀死
kill -9 $(ps aux | grep "omcDevApp" | grep -v grep | awk '{print $2}')
ps aux | grep omcDevApp
```

```bash
ps aux | grep "omcDevApp"

process_id=$(ps aux | grep "omcDevApp" | grep -v grep | awk '{print $2}')
if [ -n "$process_id" ]; then
  kill -9 "$process_id"
else
  echo "未找到匹配的进程"
fi

go version
go mod download

cd restagent/
go build -ldflags="-s -w" -o omcDevApp

BUILD_ID=dontKillMe
nohup ./omcDevApp -c ./dev.yaml > ./dev.log 2>&1 &
echo ok

```