Linux is actually a timed task . Old can't remember parameters, this time write down, save the old Baidu. This article does not have the technical content, please everybody not to spit the trough.
================================================================
Execute the/opt/aa.py file with Python 4:00:01 every day.
To edit a timed task:
#crontab-E
Join:
0 4 * * * python/opt/aa.py
Save and exit.
================================================================
crontab command format:
* * * * * command
M H d M d command
M: Cents (0-59)
H: Hours (0-23)
D: Day (1-31)
M: Month (1-12)
D: Week (0-6) 0 for Sunday
* Represents a number in the range of values
/on behalf of "every"
-Represents a number to a number
, which represents a discrete value (list of values)
Example:
Execution per minute:
* * * * * * date>>/opt/test.log
Equivalent
*/1 * * * * date>>/opt/test.log
Note that every minute means that the 1th second of every minute begins to execute.
Open a Test.log file and you'll find the result: Sat Oct 14:25:01 CST 2013
Execute every 4 hours:
* */4 * * * date>>/opt/test.log
Executed every Sunday:
* * * * 0 Date>>/opt/test.log
Executed every Saturday and Sunday:
* * * * * 6,0 Date>>/opt/test.log
The first 5 minutes per hour is performed:
5 * * * * date>>/opt/test.log
Very simple, just remember the position and the meaning of the line.
Reference address
CentOS timed Python script execution