Use crontab you can perform a specified time in the Shell script or a series of Linux command. For example, the system administrator schedules a backup task to run every day
Entry
# crontab–e
This enables the edit mode to open the personal crontab configuration file, and then add this line:
0 0 * * */home/linrui/xxxxxxxx.sh
this will be running in the wee hours of the day of the specified . SH file
Cron Description of each item
Below are crontab format of the file:
{minute} {Hour} {Day-of-month} {Month} {Day-of-week} {Full-path-to-shell-script}
o minute: interval is 0 – -
o Hour: interval is 0 – at
o Day-of-month: interval is 0 – to
o month: interval is 1 – 1 1 month . Yes month
o Day-of-week: interval is 0 – 7. Sunday can be 0 or 7.
Crontab Example
1 , in early morning 00:01 Run
1 0 * * */home/linrui/xxxx.sh
2 , every weekday 23:59 are backed up by a backup job.
* * 1,2,3,4,5/home/linrui/xxxx.sh
or the following:
* * 1-5/home/linrui/xxxx.sh
3 , run commands every minute
*/1 * * * */home/linrui/xxxx.sh
4 , each month's 1 number 14:10 Run
1 * */home/linrui/xxxx.sh
Crontab options for Commands
Below are crontab the effective Options :
crontab – e: Modify crontab file . If the file does not exist, it is created automatically.
crontab – L: Show crontab file.
Crontab-r: Delete crontab file.
Crontab-ir: Delete crontab The user is alerted before the file.
Free pick upBrother LianITEducationOriginalLinuxMaintenance EngineerVideo/elaborateLinuxtutorials, more information on the official website customer service:http://www.lampbrother.net/linux/
learn PHP, Linux, HTML5, UI, Android and other video tutorials (Courseware + notes + video)! Contact Q2430675018
Linux Welcome to join the Exchange group Group number: 478068715
Crontab let Linux execute shell scripts at timed intervals