(1)crontab每10秒执行一次
* * * * * /bin/date >>/tmp/date.txt
* * * * * sleep 10; /bin/date >>/tmp/date.txt
(2)还可以用以下方式表达
string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, " 0 0 1 1 * ".
@annually (same as @yearly)
@monthly Run once a month, " 0 0 1 * * ".
@weekly Run once a week, " 0 0 * * 0 ".
@daily Run once a day, " 0 0 * * * ".
@midnight (same as @daily)
@hourly Run once an hour, " 0 * * * * ”.
2、踢用户下线
root@iZ94hgp4s2xZ:~# w
10:15:27 up 1 day, 19:20, 2 users, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
jediael pts/0 218.107.55.252 09:15 31.00s 0.13s 0.13s -bash
root pts/1 218.107.55.252 10:15 1.00s 0.02s 0.00s w
root@iZ94hgp4s2xZ:~# pkill -kill -t pts/0