#!/bin/sh #获取前一天的日期 date=`date -d "yesterday" +%Y_%m_%d` #复制原始nohup.out到备份目录,并以前一天的日期进行命名 cp /bzd/project/Cold_Api6200/logs/nohup.out /bzd/project/Cold_Api6200/logs/$date.out #清空原始nohup.out中的内容 cat /dev/null > /bzd/project/Cold_Api6200/logs/nohup.out export GO111MODULE=off nohup ./Cold_Api6200 >> ./logs/nohup.out 2>&1 &