首页 > Linux操作系统 > Linux操作系统 > linux shell 每秒运行
[root@web01 tmp]# cat /tmp/secondrun.sh
#!/bin/sh
while [ true ];
do
/bin/sleep 1
/bin/date >> /tmp/date.log
done
[root@web01 tmp]# nohup /tmp/secondrun.sh 2>&1 >/dev/null &
[root@web01 tmp]# /tmp/secondrun.sh &
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/90618/viewspace-1068099/ ,如需转载,请注明出处,否则将追究法律责任。