1.编写shell脚本
[root@master test1]# vi ceshi.sh
!/bin/sh
while [ true ]; do
/bin/sleep 1
/bin/date >>/test1/out.txt
done
- 给shell附加权限
chomd +x ceshi.sh
3.运行
nohup /test1/ceshi.sh 2>&1 > /dev/null &
4.查看输出文件
tail -f /test1/date.txt
1.编写shell脚本
[root@master test1]# vi ceshi.sh
!/bin/sh
while [ true ]; do
/bin/sleep 1
/bin/date >>/test1/out.txt
done
chomd +x ceshi.sh
3.运行
nohup /test1/ceshi.sh 2>&1 > /dev/null &
4.查看输出文件
tail -f /test1/date.txt