① 清理nohup.out日志:
cp /dev/null /home/xxx/nohup.out
② 定时清理:
while : ;do cp /dev/null /home/xxx/nohup.out && sleep 300; done
③ 建立定时清理后台任务:
将定时清理脚本保存成clean.sh
nohup ./clean.sh &
① 清理nohup.out日志:
cp /dev/null /home/xxx/nohup.out
② 定时清理:
while : ;do cp /dev/null /home/xxx/nohup.out && sleep 300; done
③ 建立定时清理后台任务:
将定时清理脚本保存成clean.sh
nohup ./clean.sh &