DAY-10 Linux Basics and shell scripts

Source: Internet
Author: User
Tags crontab example

One, Service for NFS

1. NFS is the abbreviation of the network file system, which is the web filesystem. For shared storage between Linux systems, NFS relies on RPC protocol during file transfer or information transfer, RPC idea: A client is a server, the execution command is the client, the remote call is to send the command to the server, after the server execution, the results are sent back to the customer

2. installation package: Yum Install Rpcbind nfs-utils–y

3, modify the configuration file: Do the file system (add a hard disk), mount a directory, share the contents of this Directory through NFS

Vim/etc/exports For example:

Start Service: Systemctl start NFS

Exportfs displaying the directory shared by the client

Showmount–e Viewing configuration information

4, re-open a machine, the way to view the shared directory through the network, the client does not have to modify the configuration file, only need to download the package and the IP address, mount the directory on the server Mount server Ip:/share/own side of the path

Df–t View the file system type, after the successful mount after the local opt-in file, you can view the file in the shared directory

Ii. Crond Scheduled Tasks

1, the background operation, to the scheduled time will be automatically executed, the premise of manually set the scheduled tasks in advance

2. The scheduled tasks are divided into 2 categories (System level and user level)

"System-level configuration file under Vim/etc/crontab

Print ASB at/tmp/test.log per minute as root

Tailf–f/var/log/cron Dynamic View log (which task has been executed), you can directly view the printing information under Tail–f/tmp/test.log

"User-level scheduled task Crontab–e–u root to write commands directly within the file (be sure to write absolute path)

crontab Example: 30 21 * * * every 21:30 P.M.

45 4 1,10,22 * * 1, 10, 22nd 4 points per month 45

10 1 * * 6,0 、天 1 10 per week in Six

0,30 18-23 * * * every 30 minutes from 18 to 23 every day.

Iii. Shell (scripting language and Bash command interpreter)

1. The command executed at the terminal is a language that can be recognized by a person, and a terminal translates into a language that can be recognized by the machine to perform

2, write the command written in the terminal directly in a file, and then through the SH execution can see the results (Bash can also be executed), this kind of execution way to interpret the execution

3, the command is divided into:

==> Alias
==> Compound Commands
==> function
==> build_in
==> Hash
==> $PATH
==> Error:command not found

Get a command according to the above priority to find, first find the same name alias command, and then find the compound command ...

The alias command is intended to simplify the integration of the output to a long parameter command, alias definition method aliases la= ' Ls-al ' Alias Unalias la

Internal command: Is the command of bash comes simple, internal command help in BUILTIN (1)

External command: is a small program exists in/bin//sbin//usr/bin and other places

CD is an internal command that belongs to the Bash software comes with a command that does not have an alias defined

Four, meta characters

A line of special symbols on a keyboard number is called a meta-character

DAY-10 Linux Basics and shell scripts

Related Article

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.