Add scheduled tasks in Linux

Source: Internet
Author: User

How to add a scheduled task in Linux: Use crontab to add a scheduled task.

Linux will add the started service to the memory, and the service will read her own configuration file for work, input and output, and add the output content to the input and output.

Linux is a huge ecosystem. Hardware environments include hard disks-memory-processors. Among them, hard disks are used as resource storage media, which is equivalent to a huge granary where various resources are stored, the granary is very large, but it is very slow to take things from the hard disk, and the places where humans eat are not in the granary, while the places where humans eat are in the canteen.

The items from the granary are stored in the kitchen storage room, which is the memory. The memory can also include the storage room and the front-end processing window, and the files obtained from the hard disk will be stored in the memory, that is, the program-binary executable file. The binary executable file is used as a reserve and dumped into the storage room of the kitchen. These items stored in the memory are called services. programs stored in the memory are placed in the CPU for calculation. The result is that the chefs in the kitchen are cooking, after processing various raw materials and outputting the results, the results will be returned to the memory after calculation. In the dining room where humans eat, if it is a CS architecture, it is a browser, the CPU computing result is stored in the memory. There is a window in the dining room. People will go to the dining room window to order food. The order is an http request, and the http request reaches the server through the network, when the server establishes a TCP/IP connection, the application server will process the request. For example, tomcat is the reception lady at the front end. After the tomcat process is started, it will be placed in the memory, after receiving the http request, she will establish a connection, that is, to make a list, and tomcat will establish an ESTABLISHED connection. After tomcat receives the request, the memory is put into the CPU for calculation, after the results are obtained, output them to the memory again, and then extract the items from the hard disk, send them to the memory, and send them to the customer through the network, so that the customer can get themselves from the canteen. I want to eat.

The metaphor of the canteen, granary, and storage room is not an image ...............................

In Linux, a scheduled task has a process named crond. Her configuration file is in the/etc/cron * file. The user uses the crontab task and the command: crontab-e for editing.

*/1 */home/manager/ps. sh

Minute Hour year month day

The above settings are executed every minute, and then the file is saved in/tmp.

Run ps-ef | grep crond to check whether the crond service has been started.

If it is not started, use the root user to start the crond service: service crond start

Ubuntu uses crontab for scheduled tasks

Linux Crontab scheduled task

Study crontab scheduled task notes in Linux

Scheduled Task Scheduling in Linux-crontab command

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.