Linux Learning Notes Post process (cron and crontab)
. Set the crontab file and use it to submit the job
. To submit a job using the AT command
. Submitting jobs in the background
. To submit a job using the Nohup command
Cron system scheduling process that uses it to run a job at off-peak hours per day, or to run at different times during the week or January
At command to run some special jobs at a specific time
& Use it to run in the background a process that takes no time to grow
Nohup uses it to run a command in the background, even if the user exits without being affected.
3.1 Cron and Crontab
Cron is a system-scheduling process that runs jobs without human intervention.
The crontab command allows the user to submit, edit, or delete the corresponding job. Each user has a crontab file to save scheduling information.
Domain of 3.1.1 crontab
1th Column minutes 1~59
2nd Column Hour 1~23
3rd Liege 1-31
4th Month 1~12
5th Week 0~6
6th column the command to run
Examples of 3.1.2 Entries
* * * */apps/bin/clearnup.sh
21:30 runs per night in the/apps/bin directory of the cleanup.sh
4 1,10,22 * */apps/bin/backup.sh
The monthly 1,20,22 number 4:45 executes the/apps/bin directory under the backup.sh
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
Every day in 18:00~23:00 every 30 minutes to execute the/apps/bin directory dbcheck.sh
0 * * 6/apps/bin/qtrend.sh
23:00 Executive/apps/bin/qtrend.sh per Saturday
Command options for 3.1.3 crontab
crontab [-u user]-e-l-r
-U user Name
-e Edit Crontab file
-l list contents of crontab files
-R Delete crontab file
3.1.4 Create a crontab file
Crontab Faintbearcron
3.1.5 List crontab files
Crontab-l
Crontab-l > $HOME/faintbearcron
Backup
3.1.6 Edit Crontab File
Crontab-e
3.1.7 Delete crontab file
Crontab-r
3.1.8 recover the missing crontab file
Crontab <filename>
where <filename> is the filename of your copy in the $home directory