Take the CentOS system as an example to realize automatic database backup.1. Write a shell:
12
#! /bin/bashMysqldump -cp --user=root --password=' 123 ' dbName | gzip > ~/db/dbname -'date +%y%m%d%H '. SQL. GZ ;
This article ljh2000Author Blog: http://www.cnblogs.com/ljh2000-jump/Reprint please specify the source, infringement must investigate, retain the final interpretation right!Title Link: HDU5730Positive solution: divide and Cure $fft$Problem Solving
SummaryThis chapter describes how to use ls and stat to expose files and file meta data , and how to use Touch set the time stamp not seen . Touch can display information about datetime and scope limitations on many existing systems .Shows how to
Netstat
netstat-print network connections, routing tables, interface statistics, masquerade connections, and Mul Ticast Memberships
See Parameters:
-A (All) displays all options and does not show listen related by default-
1. Regular expressions1) ^ Start * Previous character repeats more than 0 times+ More than 1 times? 0 or 1 times. An arbitrary character (. *){m,n} m to n times[0-9] [A-z] any number or letter$ end Character2) sed and awk commandsSed ' match
Conditional judging TypeAs long as the procedure, then the conditional judgment, that is, if then this discriminant must be learned, the other is Case...esacIf....thenThis is If...then is the most common conditional judgment, it is divided into
File LookupFind------directory------1. Search Conditions2, after the file search processing----------------1. Search Conditions 1.1) Matching of file names && Multi-condition name matchingYou can use regular expressions to match, and-a or-o in
I am not a professional Linux, usually do not work in Linux programming, self-learning some Linux shell programming, forget to learn, learn to forget, efficiency is not high. Today is the right to review it.Think of a scenario where you get a
IDC small rookie one, non-trained. There are often customers with CentOS servers that need to allocate 15 IPs or even 30 IPs. Each time a manual assignment was cumbersome, it took a day to learn the shell script and write the
Bash is the default scripting language in a Linux system, and since it is a programming language, debugging of scripts is essential. Here's a simple debugging approach to bash:1 using Bash's parameter-X, such asBash-x a.sh+ for A in ' bafa{1..4} '+
The case statement and the judgment statement [If...elif...else] function similarly;When logic is relatively simple, the code is much less than the latter.Case usage, use a variable to match a value, if the match succeeds, execute the command below
Automated deployment and monitoring of development scripts1. Scripting automatic deployment of reverse proxy, web, NFS;Requirements: I, the deployment of Nginx reverse proxy three Web services, scheduling algorithm using weighted polling;II, all Web
Special characters:#! Sign of the beginning; Delimiters with multiple commands together[Email protected] log]# echo A;echo b;echo CABC. Multiple functions:1. Equivalent to the source command2. As part of the file name (hide filename) (use ls-a to
Method One: Switch to the directory where the shell script executes the shell script:cd/data/Shell. /hello.shThe./means to execute hello.sh under the current working directory. If you do not add./,bash may respond to an error message that could not
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