Linux Learning notes after the platform process (cron and crontab) __linux

Source: Internet
Author: User

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


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.