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 ;
Use the-e parameter of MySQL can perform various kinds of SQL (create, delete, add, erase, change, check) and other operationsUsageMysql-uxxx–pxxx-e "MySQL Command" Of course, you can also use the following notation MYSQL-E-uxxx–pxxx "mysql
Recently received the manager request to the RHEL7 LVM new partition expansion automation, because uses the virtualization platform, therefore uses to add the new disk the way to do:#!/bin/bash# #在线扫描新磁盘# #Step1: Recognize New hard
1. Purpose(1) Shell knowledge Summary. Good memory is better than bad writing, finishing the relevant shell knowledge and combining their own practical experience to organize, the content will not involve all the knowledge points, will only cover
The first is to create the shell daemon: (shouhu.sh)#!/bin/bashtest () { while true do ls ./ >> 123.txt sleep 5 done}case $1 instart) path= "/root/shouhu.pid"
The nature of the shell
The shell of the Linux system is equivalent to the "one shell" of the operating system, which is the command language interpreter, which provides the user with an interface to use the operating system. It does not belong to
Original blog, reproduced please indicate the sourceThe shell is the command interpreter.See which shells are supported by this system1 Tab Command completionThis almost every time can be used, for example, I have a file called file.txt, assuming
Using SH to write small scripts can make the job easier. Part of the content may be more unfamiliar to everyone (at least I am).is the variable related to the expansion, the following are some simple description and use of the method. To make the
Add 20 users to the CLASS01 group in bulk, the user name begins with STD, ends with a number, format: STD01---STD20Method 1#!/bin/shgroupadd class01a=stdfor ((i=1;iMethod 2:#!/bin/bashgroupadd class01for i in {1..20}doif [$i-lt];thenuseradd "std0$i"-
The head of the Sunset Building, the voice of the hung, Jiangnan wandering. The Wu hook to see, the railing shot all over, no one will, boarding meaning. --Deng Jiankang and Heart PavilionThe hill algorithm is a sort algorithm proposed by Hill
Q1. ArraysWe know that variables are memory space, each variable can only store a single data, a one-time assignment operation, then encountered some need to continuously store and read the task, if you still rely on the variable for multiple
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