Execute one shell script per second)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.