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
I. The existence and judgment of documents-D to determine if the file exists and whether it is a directory file (the directory is true)-E to determine if the file exists (exists as true)-F to determine if the file exists and is a normal file (the
linux-Shell core and shell relationshipThe kernel is in the shell, interacting with the shell (command line) through the shell#####################################################################################################Shell Viewwhich $SHELL/
Experiment FourBasic usage of 1.shell variables and usage of common symbols(1) Change the main prompt to the user's home directory name(2) Assign the string dos file c:> $student * to the variable x and display it(3) In the shell command Terminal
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
1> file Comparison:-d filename checks if filename exists and is a directory-e filename checks if filename exists-F filename checks if filename exists and is a file-r filename checks if filename exists and is readable-s filename Check if filenmae
First, if else1.1, ifIf statement syntax format:if condition Then command1 command2 ... fiWrite a line (for the terminal command prompt):if [$ (PSgrep"ssh"1thenecho" True"fiAt the end of the fi is if the upside-down spelling, and later
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
Function Description: Cleans the Messages history log file (Messages-date) under the/var/log/path, but does not clean the messages file itselfDependency requirements: The BC module is installed on the server1 #clean_logs.sh2 #!/bin/bash3 4 # ========
First,ShellFour The Swordsman (grep)grep fetch rowsRegular Expressions:
[0-9] denotes character match 0-9{1,3} indicates that the number of matching characters is less than 3.
Example one:
[email protected]
Create a TXT file in the "/home/hadoop/" directory of your local Linux file system, where you can enter some words.mkdir hadoopcd Hadooptouch Test.txtgedit test.txt
To view the file location locally (LS)Ls-al
Displaying the contents of a file
Requirements: Use the shell to customize a variety of personalized alarm tools, but the need for unified management, standardized management.Idea: Specify a script package that contains the main program, subroutine, configuration file, mail engine,
One, Shell command application exercises1. Describe the purpose of the following documents①/etc/passwdpasswd is a password file that is used to manage the user's password. Ordinary users can usually only modify their own password
I. Functions in the shellThe function is to organize a piece of code into a small unit, and give the small unit a name, when the code is used to call the name of the small unit directly.1. function formatfunction f_name() { command}The
When the shell initializes the installation script, it is necessary to install some RPM packages from the network, all of which need to detect the smoothness of the network first.Code#检测网络链接 &&FTP upload Datafunctionnetworkandftp () {#超时时间 timeout=5#
First, Shell script introduction
The shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language.
The shell is a scripting language;
Can use logic
1. ExercisesWrite a script that calculates the size of all processes in the Linux system and2. Exercise Analysis 2.1. First question, where to collect data for a processUse top or PS to get the memory usage size of each process. Once the size is
Java real-time program in the process of occasional abnormal information interruption in the case, through the shell script to complete the self-boot.The following is a shell script that monitors a real-time Java program.Determine if the program is
ArrayAn array is an ordered sequence of elements. If a collection of variables of the same type is named, the name is an array name. Each variable that makes up an array is called the component of an array, also known as an element of an array,
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