Linux learning note back desk process (cron and crontab)

xiaoxiao2021-03-06  42

Linux learning note back desk process (cron and crontab)

. Set the crontab file, and use it to submit the job. Use the AT command to submit the job. Submit jobs in the background. Use the NOHUP command to submit the job

The CRON system scheduling process uses it runs jobs in a non-peak load time period every day, or runs at different times in a week or in a month, runs some special homework at a specific time & use it runs in the background. The process NOHUP uses it runs a command in the background, even if the user is exited.

3.1 Cron and crontab

Cron is a system scheduling process that runs jobs without manual intervention. The crontab command allows the user to submit, edit, or delete the corresponding job. Each user has a crontab file to save dispatch information.

3.1.1 crontab domain

Less 1 ~ 59 Less 2 Hours 1 ~ 23 Less 1 ~ 31 Chapter 4 Month 1 ~ 12 Level 5 The 3rd column of the week 0 ~ 6 Level 6 To run the command

3.1.2 Examples 30 21 * * * /Apps/bin/clearnup.sh Run / Apps / Bin Directory per night Cleanup.sh

45 4 1, 10, 22 * ​​* /Apps/bin/backup.sh's 1, 20th, 22nd, 4:45 per month, executable / apps / bin directory backup.sh

10 1 * * 6, 0 / bin / Find -Name "Core" RM {} /; every Saturday. Day 1:10 run a find command

0,30 18-23 * * * /APPS/bin/dbcheck.sh Execute / Apps / Bin directory Dbcheck.sh every 30 minutes every 30 minutes per day

0 23 * * 6 /Apps/bin/qtrend.sh execute /APPS/BIN/QTrend.sh on Saturday 23:00

3.1.3 CRONTAB Command Options

Crontab [-U user] -e -l -r

-u User Name-E Edit crontab file -l lists the contents of the crontab file - R De De De Dete

3.1.4 Creating a crontab file crontab FaintBearCron3.1.5 lists crontab file crontab -l

Crontab -L> $ HOME / FAINTBEARCRON (Backup) 3.1.6 Edit crontab file crontab -e3.1.7 Delete crontab file crontab -r3.1.8 Recovery lost crontab file crontab where is in the $ home directory The file name of the copy

转载请注明原文地址:https://www.9cbs.com/read-66722.html

New Post(0)