Linux Learning (iii)

Source: Internet
Author: User

Crontab

There are generally two types of at and cron,at that are typically used in tasks that only need to be performed once, and Cron is used for those loops of work. Each user can have their own crontab file, but in a larger system, the system administrator will generally prohibit these files, but only the entire system to keep one such file. System administrators prohibit or allow users to own their own crontab files through the Cron.deny and cron.allow two files. Each entry in the crontab file corresponds to a task, and each entry has six fields: minutes 1-59, 0-23 hours, day 1-31, month 1-12, week 0-6, commands to run. The entry format is:
Points < > < > Day < > Month < > Week < > Commands to run
Where <> represents a space.
Crontab Entry Examples
Here are some examples of crontab file entries:
21* * */apps/bin/cleanup.sh

The above example indicates that the/apps/bin directory is running at the cleanup.sh of 21:30 per night.
4 1,10,22 * */apps/bin/backup.sh
The above example shows the backup.sh in the 1, 10, and 22nd 4:45 runs of the/apps/bin directory.
1 * * 6,0/bin/find-name "core"-exec rm {} \;
The above example shows that 1:10 runs a find command every Saturday and Sunday.
0,30 18-23 * * */apps/bin/dbcheck.sh
The above example shows that the dbcheck.sh in the/apps/bin directory runs every 30 minutes from 18:00 to 23:00 every day.
0 * * 6/apps/bin/qtrend.sh
The above example shows the 11:00pm running the/apps/bin directory qtrend.sh every Saturday.
The general form of the crontab command is:
Crontab [-u user]-e-l-r
which
-u user name.
-e Edit the crontab file.
-l lists the contents of the crontab file.
-R Delete the crontab file.

System Services:

The daemon process is a process that runs in the background and does not rely on the front end. Generally starting from the start of the system to provide critical services. Generally divided into two categories, one is the independent start, the other is Super Daemon, is through the super-service management to unified management.
Common system Services:
ATD: Configuration file:/etc/at.allow,/etc/at.deny
Preset Port: None
Description: An automated run task.
Whether you need to start up: Usually you need to start. However, if you have been using cron, you can not start.
Crond: Configuration file:/etc/crontab
Preset Port: None
Description: A daemon used to perform routine commands.
Whether to start: Must be started.
HTTPD: Configuration file:/etc/httpd/httpd.conf,/etc/sysconfig/httpd
Preset Port: 80,443
Description: Provide WWW service.
Whether you need to start: Install WWW service to start it.
Iptables: Configuration file:/etc/sysconfig/iptables
Preset Port: None
Description: Is a famous firewall on Linux, if connected to the Internet, be sure to open this.
Whether you need to start: the host connected to the Internet must be started.
Network: Configuration file:
/etc/sysconfig/network
/etc/sysconfig/network-scripts/*
Preset Port: None
Description: Is used to manage the network, so of course to start, regardless of whether you have a network card, the service will also start, because at least the network will drive lo this interface.
Whether to start: Must be started.
SSHD: Configuration file:
OpenSSH server configuration file:/etc/ssh/sshd_config
OpenSSH Client configuration file:/etc/ssh/ssh_config
Preset Port: 22
Description: Secure Shell Protocol for safe remote login to the management host.
Whether to start: if you want to implement remote management, you need to start

Syslog: Configuration file:/etc/syslog.conf

Preset Port: None

Description: Records all system behavior.
Whether to start: Must be started.
VSFTPD: Configuration file:/etc/vsftpd/vsftpd.conf
Preset Port: 21,20
Description: FTP Server software.
Whether to start: if you want to provide an FTP service.
XINETD configuration file:/etc/xinetd.conf
Preset port: Not necessarily, depends on the set value.
Note: xinetd, as a successor to INETD, is responsible for managing infrequently used services in the system, which are run by the XINETD service when requested, and once the service request service is completed, this can effectively reduce the utilization of system resources. Typically, XINETD manages programs that have Telnet, FTP, rsh, and Rlogin. Shutting down the inetd also shuts down the services that it manages.
Whether to start: Must be started.

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.