Automatic backup of the entire database
Implement a library to back up a file
Implement exclude libraries that do not require backup
Implementing Backup to Compressed files
Implementing a backup file that defines how many days
Tag: element represents article string output shard for form berThe role of variablesForbidden spaces on both sides of the equals signFor loop#语法一 for variable in value 1 value 2 value 3 : Do block done # #语法二 the for variable '
Shell scripts are especially important in the daily operations, and often we write shel scripts that involve a lot of privacy information, including passwords, which requires the shell script to be encrypted and the results to be executed. The
Shell: 1, local variables: variables available only in the current shell, 2, Environment variables: variables available for the current Shell's child processes 3, Shell variables: some shell Set the special variables, such as: $ $, $ ... These
Shell Basics1. What is a shellShell is a program developed by C language he is a bridge for users to use Linuxis both a command languageAn application This application provides an interface through which users access the operating system kernel's
Different shells have different functions, the shell also decided that the default shell in Linux is/bin/bash, the popular shell has ash, bash, Ksh, CSH, zsh, and so on, different shells have their own characteristics and use.BashThe Shell,bash
Click Back to learn the path of the Linux command line and shell script5.1-shell Parent-child relationship1 common types of shells
Bash is the Linux standard default Shell, which is an abbreviation for the Bunrneagain shell, with a total of
1. ${ }A more precise range of defined variable names is used for variable substitutionFor example:A=bEcho $ABOriginally intended to replace the result of a $ A and then a B-letter followed, but on the command line, the real result is only replace
1. Basic usage of shell variables and usage of common symbols( 1 ) Change the main prompt to the user's home directory namePS1 value restores default values after re-login.(2) the string DOS file c:>\ $student \* assigning values to variables x ,
Find./-mtime 18-exec ls-l {} \;Special places in this example are {} and \; And the-exec keyword, the meaning of these things:
{} stands for "content found by find" and, as shown, the result of find is placed in the {} position;
-exec
DownloadPlease download it to https://github.com/mbadolato/iTerm2-Color-Schemes.git clone https://github.com/mbadolato/iTerm2-Color-Schemes.gitInstallationTo install:
Launch ITerm 2. Get the latest version at iterm2.com
Type cmd+i (? +i)
CTRL + A: Adjust the cursor to the beginningCtrl+e: Adjust cursor to endCtrl+u: Delete the command before the cursorCtrl+k: Delete the command after the cursorCtrl+r: Search A History list for a command "search for a History"Ctrl+l: Clear ScreenCTRL
Case requirementsBatch build Linux users with shell scriptsImplementation requirements: Create user student1 to Student50, specify Group as student group! And each user needs to set a different password!Implementing scripts#!/bin/bashgrep ‘student‘ /
Basic composition:find pathname-option [-print-exec-ok ...]Classify the attributes of the memory parameters ~Pathname: Specifies the query root path of the find command, such as '/', './'.You can also specify the search path in the-path
declaring functionsDemofun () { echo" This is my first shell function! " }Function name () {... function body}In the shell, arguments can be passed to a function when it is called. Inside the function body, the value of the parameter is obtained
View Catalogawk ' {if (!system ("test-d")) print $} 'Batch Quick Create user for in user{0.. Ten Do useradd $i echo123456passwd --stdin $i DoneUse the IF statement to determine#!/bin/bash# file Judgmentif[-E $1]; Then Echo "File
File Comparison characters-e filename true if filename exists [-e/var/log/syslog]-D filename True if filename is a directory [-d/tmp/mydir]-F filename True if filename is a regular file [-f/usr/bin/grep]-L filename True if filename is a symbolic
1. TopicsWrite a script to determine whether the 80 port of the machine (assuming the service is httpd) is open, if it is open to do nothing, if the discovery port does not exist, then restart the httpd service, the concurrent mail notify yourself.
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