Mysqldump Full backup shell script

#!/bin/bash#? date:2017-10#? version:0.1#? description:db_user= "root" myisam_db= "MySQL" db_passwd= "123456" host= "localhost" backup_dir= "/opt/backup/mysql/sql "Log_file="/opt/backup/mysql/sql/mysql_backup.log "keep_days=30mysql=" $ (which?mysql)

Excerpt from the Shell Scripting Learning Guide---1

1, numeric and numeric expressionsAWK does not provide a string-to-number function, but awk is simple: Add a 0 to the string, such as S = "123", then N = 0 + S, and assign the number 123 to N.2. How to print the first few linesHead-n n filename#

Shell EXEC command executes shell print output to a file

[Email protected] ~]#Cat 1.SH #!/bin/bashexec1>>/tmp/2. log2>>/tmp/2. LogDate Echo 111LdkkdfkslfdsDate[[Email protected]~]# ./1.SH[[Email protected]~]#Cat/tmp/2. Log Sat June9 the: ,: +Utc2018111./1.SH: Line6: Ldkkdfkslfds:command not Foundsat June9

4.Shell determine the user's parameters

1.Shell determine the user's parametersWhen the system executes the mkdir command, it will judge the information entered by the user, that is, whether the user-specified folder name already exists, if there is an error, and the other is

Fifth. Definition, execution, parameters and recursive functions of shell functions

Fifth. Definition, execution, parameters and recursive functions of shell functionsBash (Bourne Again Shell) also supports functions, when writing large complex scripts, you can use functions to write code into a function of a relatively independent

Five week fourth lesson 8.6 pipe and job control 8.7/8.8 shell variable 8.9 environment variable configuration file

8.6 Pipe symbol and job control8.7/8.8 Shell variables8.9 environment variable configuration file 8.6 Pipe symbol and job control 1. Pipe Symbol | Pass the result of the preceding command to the following commandFor example, # cat

Shell Programming (ii)-IF judgment and special usage, file directory attribute judgment, case judgment

[TOC]Shell Programming (ii) One, the logical judgment in Shell Script 1.1 judgment Statement if1.1.1 format 1:if 判断语句;then commandfiExample 1# vim if01.sh //判断数值大小第一种方法用[],注意前后空格#!/bin/basha=5if [ $a -gt 3 ]then echo

Bash Shell Summary

Mans Bash1. How the Shell works (1)Kernel Shell UsersParent Process Fork---waitChild process Exec--exitRelated Man documents:Fork (2)Clone (2)Execve (2)Exit_group (2)EXIT4 (2)Strace (1)-->strace-e2. Shell Syntax (2)1. Simple command (kw:simple

Process Control of Shell script programming

1. Unlike Java, PHP and other languages, SH's process control is not empty, such as (the following is the PHP Process Control notation):You can't write this in Sh/bash, and if the Else branch doesn't have a statement execution, don't write this else.

Shell script One-click Install LNMP Menu mode installation

#!/bin/bash#定义软件包变量tnginx= "Nginx-1.6.0.tar.gz"nginx= "nginx-1.6.0"Tcmake= "Cmake-2.8.6.tar.gz"Cmake= "cmake-2.8.6"tlibmcrypt= "Libmcrypt-2.5.8.tar.gz"libmcrypt= "libmcrypt-2.5.8"tmcrypt= "Mcrypt-2.6.8.tar.gz"mcrypt= "mcrypt-2.6.8"Tmhash= "Mhash-0.9.

Shell script Common script: For loop

 Shellscript Common script:ForLoopsWheil Many loops can be replaced with a for loopFor loop syntax structureFor variable name in variable Value listDoinstructionDoneFor ((EXP1;EXP2;EXP3))DoinstructionDoneScript instance:For 99multiplication

Linux Learning Summary (17)-shell Basics

The content of this article is very miscellaneous, but it is not difficult to understand, do not map by example.First introduce several characters commonly used characters:1 * matches any of any characters2? Match an arbitrary character3 # comment

Golang Linux Shell Programming (i)

1. Invoking system commandsThe Exec package executes the external command, which will be OS. The startprocess is packaged to make it easier to map to stdin and stdout and to connect I/O with pipefuncstring, arg ...string) *Cmd {}Call system

Shell Loop statement

One, for-done (not very common)1. GrammarFor variable in name table do ... done2. Script Sample Code#!/bin/shfor num in 1 2 3 4 5do echo "number is $num" done3. Execute script[Email protected]]# sh hello.sh4. Implementation resultsThe number

(Stone, scissors, cloth) shell scripts, random comparisons, case applications

Script Realization Man-machine Game, Machine Application random method, combined with user input to give the result, the article has two methods, the first method is the logical aspect of the script, the second is easier to understand.One: The

Shell echo Command

The echo command of the Shell is similar to the echo command of PHP, and is used for the output of strings. Command format:echo stringYou can use echo to achieve more complex output format control.1. Display Normal string:echo "It is a test"The

Shell Signal capture Command trap

Trap commandtarpThe command is used to perform the action after the specified signal is received, usually in order to complete the cleanup when the shell script is interrupted. For example:When the script is pressed at execution time CTRL+c ,

20.Shell Introduction, History,tab key, wildcard, redirect

Five Week third session (January 10) 8.1 Shell Introduction 8.2 Command History 8.3 Command Completion and aliases 8.4 Wildcard Characters 8.5 Input and output redirection Shell IntroductionThe shell is a command

${}, # #和 in the shell

Suppose we define a variable as:Copy the Code code as follows:File=/dir1/dir2/dir3/my.file.txtDifferent values can be replaced with ${}, respectively:Copy the Code code as follows:${file#*/}: Delete the first/its left string:

2017 the latest enterprise Shell face test and enterprise operation and maintenance of a total of 30 cases

1, enterprise Shell face question 1: Batch generate random character file name caseUse the For loop to bulk create 10 HTML files in the/oldboy directory, where each file needs to contain 10 random lowercase characters plus a fixed string oldboy,

Total Pages: 541 1 .... 151 152 153 154 155 .... 541 Go to: GO

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.