How to implement a program that does not run once a minute
Source: Internet
Author: User
How to implement the program does not execute once a minute-Linux general technology-Linux programming and kernel information, the following is a detailed description. The following is a script I wrote. It stores the. SQL script in/root/test. The script is written to read the latest script and then run it.
I want to automatically run the script every five minutes, excluding adding the script to crontab. That man can give me some comments!
########============================== ######### ##
#! /Bin/sh
Sqldir =/root/test
Cd $ sqldir
Result = 'LS-lt | grep-v "total" | awk '{print $9}' | head-1'
Echo $ result
If [-x "$ result"];
Then
Echo "Now, starting run $ result ....."
Source/root/test/$ result
Else
Echo "is error, exit"
Exit
Fi
########============================== ######### ##
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