like windows has scheduled tasks.linux has crontab.
it’s a tool for excute tasks on time.
how to install crontab?we can use yum.yum install vixie-cron crontabs
then run itservice crond start
we can add it into autostart when we open the computer.chkconfig --level 345 crond on
how to use crontab
run following command to start crontab edit mode.crontab -e
crontabs’ format
Example of job definition:
.---------------- minute (0 - 59)
| .------------- hour (0 - 23)
| | .---------- day of month (1 - 31)
| | | .------- month (1 - 12) OR jan,feb,mar,apr …
| | | | .---- day of week (0 - 6) (Sunday=0 or 7) or sun,mon,tue,wed,thu,fri,sat
| | | | |
* * * * * user-name command to be executed
In addition to numbers, there are several special symbols that are “*” ,”/” and “-“.
“*” representing all the numbers in the range of values,”/”representing each meaning,”*/5″representing every five units,”-“representing from a number to a number, and”,”separating several discrete numbers.
for example:30 2 * * * sh xx.sh
run “sh xx.sh” on 2:30am everyday.*/10 * * * 1-5 sh xx.sh
from Monday to Friday, run task every ten minutes.0 17 1,5 * * sh xx.sh
every month,on the first and fifth day,when 17:00pm,run the task.
we can use crontab -l
to check the scheduled tasks.
2 Comments
free shemale dating service
May 19, 2021 at 7:25 pmfree dating sites no cost
tinder review for guys
May 16, 2021 at 4:37 pmtinder review for guys
how to use crontab to excute tasks on time – rock funs