Bird Brother private kitchens Basics: Routine Task Scheduler (crontab) Exercises

Cat Ning! ! !

Reference: http://cn.linux.vbird.org/linux_basic/0430cron.php

 

1- Today Suppose I have a command program, entitled: ping.sh the file name! I want to make this run every three minutes a file system, but it happens a lot of information in this file will be displayed, so my root account will receive letters almost four hundred letters a day, just receiving almost going crazy Lost! So I ask how the allocation should be a better arrangement?

 

This involves redirecting data flow problem, we can import files or directly discarded him! If the information is not important, then it would be dropped if information is important, then, before he preserved! If today this order is not important, so he discarded! Therefore, you can write:

*/3 * * * * root /usr/local/ping.sh > /dev/null 2>&1

 

2- you expect to be in sent a letter to kiki 14 February 2010, the only years to send! How orders?

 

at 1am 2010-02-14

 

3- issued after crontab -e, if you enter this line, what does it mean?

* 15 * * 1-5 /usr/local/bin/tea_time.sh

 

In the week of 1 to 5, 15:00 per minute, a total of 60 times /usr/local/bin/tea_time.sh this file. Pay special attention to that every week 3:01 to 5 will be 60 times ei! A lot of trouble it ~ ~ it is the wrong wording should be written as:

30 15 * * 1-5 /usr/local/bin/tea_time.sh

 

4- I use vi to edit / etc / crontab file, I edit the line that is this:

25 00 * * 0 /usr/local/bin/backup.sh

What is the significance of this line represents?

 

This line represents the ...... not make any sense! Because the syntax error! You have to understand, in the / etc / crontab which each row must have a user job! So, should you want the line originally read:

25 00 * * 0 root /usr/local/bin/backup.sh

 

5- Does your system daily, weekly, monthly you have carried out what work?

 

Because CentOS system default routine commands are placed in /etc/cron.* inside, so you can go on their own: /etc/cron.daily/, /etc/cron.week/, /etc/cron.monthly/ these three directories look inside, you know it! ^ _ ^

 

6- Every Saturday at three in the morning to have the system search within any document SUID / SGID's! And outputs the result to /tmp/uidgid.files

 

vi / etc / crontab

0 3 * * 6 root find / -perm +6000 > /tmp/uidgid.files

 

Guess you like

Origin www.cnblogs.com/landesk/p/11797568.html