Linux shell simple implementation of automatic database backup

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 ;

manipulating databases with Shell commands

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

About variable settings in the shell

Defining variablesA=Assigning values to variablesA=5' Number equals $ ()[Email protected] ~]# hostnameLocalhost.localdomain[Email protected] ~]# a= ' hostname '[Email protected] ~]# echo $aLocalhost.localdomain${-} to determine whether the variable

Linux Shell nature and how it works

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

Summarize the 8 tips you use frequently with shell command line

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

Linux shell reads every day--install Nginx

Of course this blog original code is reproduced great God's ...Automatically install Nginx script, use case mode, choose the way, you can change to the actual needs of the script you want mynginx.sh #!/bin/sh # # #nginx Install Shell # # #

Shell Learning Summary

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

Shell comparison of floating-point numbers and integers

Today, a friend suddenly asked me in the shell, how to compare floating point and integer, but I asked a Leng, in the work did not encounter this scene. We also know that the calculation of numbers in the shell is usually converted to integers, such

Shell parameter expansion

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

Seq in the shell magical

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"-

Linux Shell cat Commands

Cat: View the contents of a file, connect a file, create one or more files, and redirect output to a terminal or file usage: cat [options] [file]1. $ Cat Hello.txtdisplaying content in a hello.txt text file2. $ cat-n File-N option to display the

Shell Bulk Add Users

#!/bin/bashRead-t 30-p "Please input user name:" NameRead-t 30-p "Please input user number:" numRead-s-T 30-p "Please input user password:" PassEcho-e "\ n"if [!-Z "$name"-A!-Z "$num"-A!-Z "$pass"]ThenY=$ (echo "$num" | sed-e ' s#^[0-9]# #g; s#[0-9]*

Linux shell directives such as-D,-F,-E, and other judgment expressions

File comparison Operators-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 link

Linux Shell common Commands

For loopapplist= (App1 app2 app3); for apps in ${applist[@]};d o echo $app;d one; Get IP AddressIfconfig |grep-po ' (? Ifconfig|awk-f "[:]+" ' $4~/[0-9].+[^0-9]+/{print $4}/lo/{exit} 'Ifconfig|sed-nr ' s/^[[:space:]]+inet addr: (. *) bcast.*/\1/p '

The shell uses shift to get a bit after the entry

Sometimes the shell has a variable number of arguments, want to get the 2nd bit after the argument, as a new entry to invoke other scripts the usual way to think of this is to use traversal, for example, the following method:For ((i=2;i DoEcho $i

Shell Review First chapter

Today to write blog only to find before there is no written, my God, I was asleep ...1, what is a shell?The shell is a unix/linux system with software that acts as an interface between the kernel and the user, reads the user's input command, sends

Linux Shell Programming Commands-linux Basic Environment Command Learning notes

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

Java calls the shell script and returns the result set

1 /**2 * Run shell scripts3 * @paramShell scripts that the shell needs to run4 */5 Public Static voidExecshell (String shell) {6 Try {7Runtime RT =runtime.getruntime ();8 rt.exec (shell);9}Catch(Exception e) {Ten

Shell sequencing of data structures

#SIZE 10Direct Insert Sortvoid Insert_sort () {int i,j;int array[size+1];ARRAY[]={0,12,23,11,55,2,34,18,20,48,22};for (i=2;iArray[0]=array[i];J=i-1;while (Array[0]ARRAY[J+1]=ARRAY[J];j--;}ARRAY[J+1]=ARRAY[0];}}Binary Insert Sortvoid

Shell sequencing of data structures

#SIZE 10Direct Insert Sortvoid Insert_sort () {int i,j;int array[size+1];ARRAY[]={0,12,23,11,55,2,34,18,20,48,22};for (i=2;iArray[0]=array[i];J=i-1;while (Array[0]ARRAY[J+1]=ARRAY[J];j--;}ARRAY[J+1]=ARRAY[0];}}Binary Insert Sortvoid

Total Pages: 541 1 .... 450 451 452 453 454 .... 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.