Database backup shell Script

Law One:#!/bin/bash[!-d/server/backup] && mkdir/server/backupmysqldump-u root-a-B >/server/backup/a.sql[!-f/ Server/backup/a.sql] && mail-s "bak faile" Law II: #!/bin/shdate=$ (date +%y-%d-%m) des=/usr/src/mysql_bakmysql_u= " Root "mysql_p=" 123456 "

Shell introduction, history commands, command completion and aliases, wildcard characters, input and output redirection

Shell IntroductionThe shell is the intermediate medium used when the system interacts with the computer hardware, and it is just a tool of the system. There is a layer of things between computer hardware-the system kernel. If computer hardware is

MAC Shell Notes

Used to automate some of the front-end publishing operations.Script:# Webreleasepath is used to publish the directory, Webrevisionpath is the development of the directory

Shell SSH Remote execution command

Tag: Request an ipad address not with two use data std nal[Email protected] shell]# vi backup.sh #!/bin/sh ipaddress=172.17.167.38 ssh-tt [email protected]$ Ipaddress-p Note: If SSH does not add the TT parameter (indicating that no TTY is

Shell loops and traversal

Enter parameter traversal########## [email protected] indicates a parameter string#!/bin/bashecho [email protected]For i in [email protected]; DoEcho $iDoneSelf-incrementAs far as I know, in bash, there are currently five ways to do this:1. i= '

Summary of the shell face questions

1. Write a script to determine what the IP of the current online user is (there are many methods) in the 10.0.0.0/24 network.#!/bin/shfor N in ' seq 254 ' does ping-c1-w1 10.0.0. $n &>/dev/null If [$?-eq 0] then echo "10.0.0. $n is up

Shell file permissions and script execution

I. Rights Management1. View file propertiesLs-l2. Permission TypeIi. Linux Users and permissions1. User Management① Viewing usersID User1② adding usersUseradd user1③ Deleting a userUserdel-r user11. User Group① New GroupGroupadd G1② Deleting a

Shell Review Notes

-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- *-*-*-*-*-Cyclic Judgment class-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-

A shell script that automatically generates an AWR report

Recently learning shell programming, a little bit of gadgets to automate the collection of AWR reports, to facilitate problems in the system when troubleshooting.The contents of the script are as follows, the system collects the AWR report from 20 o'

Shell Analysis Nginx Log

The following scripts are based on the above log format, and if your log format is different, you need to adjust the parameters behind awk. in the analysis log UserAgentCat Access_20130704.log | Awk-f "\" "' {print $ (NF-3)} ' | Sort | uniq-c | Sort-

Shell Getting Started exercise

* * Define local variables, local variables will expire when exiting the shell client * ** * Single quote: Output AS-is * ** * Double quotes: If there are variables, the variables will be output * ** * No quotation marks: Output variable * *You can

How to write a shell script

1. First create a directoryVI hello.sh2. Write the first line of the shell#!/bin/bash (in order to declare a shell script, the first line must be written like this)3. You can add comments #the First program (this line of add # is not in effect)4.

Shell exercises-processing logs

Write a script to find the/data/log directory, the last created time is 3 days ago, the suffix is *.log file, packaged and sent to 192.168.1.2 Service under/data/log, and delete the original. log file, leaving only the packaged

Easy to use shell small programming

1 "Judge input as number, character or otherScript code:Test results:2 "Averaging:Test results:3 "self-reducing output:Script code:      Test results:4. Add a prefix to the file:Script code:Effect Display:5 "Batch test file is present:Script

Linux is called shell script to delete files

Writing ScriptsVI delbak.shThe code is as follows :#!/bin/shlocation= "/home/mysql/backup/"Find $location-mtime +7-type f |xargs rm-fexplanation :Location is the directory where the lookup is set--mtime +7 is set to 7 days ago (delete files from

Shell Exercises-judging functions

Use the conditional function if to compose a shell function called F_judge, which implements the following functions1) when the/home/log directory exists, move the files or directories that start with all TMP in the/home directory to the/home/log

Pipe and job control, shell variables, environment variable profiles

Pipe character and job control; indicates that the previous command executes the next command in sequence[email protected] ~]# cat 1.txt |wc-l; Cat 1.txt |grep ' aaa '2AAAAAAAAAAAaqweaaaaaaaaa&&: The previous command is correct to execute the

Shell Execution Order

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/AC/wKiom1cGe1ui4oqIAABm6P93Pb8114.jpg "height=" 142 " Width= "192" alt= "Wkiom1cge1ui4oqiaabm6p93pb8114.jpg"/> Shell script to today, I can only kept

Common shortcut key collection under Linux terminal shell

Delete"Ctrl" + "D" removes the character at the cursor location equivalent to VIM x or DL"Ctrl" + "H" removes the character in front of the cursor, which corresponds to the HX or DH in vim."Ctrl" + "K" removes all characters after the cursor

Shell Programming (v)

Learning from the previous articles, we learned the basic syntax of the shell. In the actual operation of Linux, we often see the command will have many parameters, such as: Ls-al, and so on, then how this parameter is handled? Let's take a look at

Total Pages: 541 1 .... 443 444 445 446 447 .... 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.