Linux a simple Execute command shell script per second 2012-08-06 11:47:06
Category: Python/ruby
A server was migrated last week, the data of one of the items is not updated, the data of the original server is queried, the data is updated, the Rsync service is found, the data is transferred from other servers, so how do I find this server?
Because it is transferred from remote to local, and is not very frequent, manually find communication records, no results.
Wrote a script to track down, considering the problem of short communication times.
Requires a command to execute once per second, but the Linux-brought Cron is not possible, and the new version of Cron is said to be accurate to seconds.
1. Write the shell script:
#!/bin/bashwhiletruedo/bin/sleep1grep 873 >>/usr/local/scripts/873. Log done
2, and put in the background to run:
/usr/local/scripts/grep873. SH &
3. Use the TAIL-F command to track logs.
Execute a shell script per second) (GO)