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 ;

Write bulk-packaged log scripts with the shell

Script 1#!/bin/bashdate=$ (date +%y%m%d%h%m) name=$ (echo $1 | awk -f ', '   ' {Print NF} ') Log_path= "$" if [ $# -ne 2 ];then    echo  "USAGE: sh  $0 log_name1,log_name2 log_path "    exitfifor NUM in " seq  1  $NAME ' do    log_name=$

HDU5730 Shell Necklace

This article ljh2000Author Blog: http://www.cnblogs.com/ljh2000-jump/Reprint please specify the source, infringement must investigate, retain the final interpretation right!Title Link: HDU5730Positive solution: divide and Cure $fft$Problem Solving

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

Useful shell Commands

Netstat netstat-print network connections, routing tables, interface statistics, masquerade connections, and Mul Ticast Memberships See Parameters: -A (All) displays all options and does not show listen related by default-

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

Shell condition judgment

Conditional judging TypeAs long as the procedure, then the conditional judgment, that is, if then this discriminant must be learned, the other is Case...esacIf....thenThis is If...then is the most common conditional judgment, it is divided into

Shell File Lookup command find

File LookupFind------directory------1. Search Conditions2, after the file search processing----------------1. Search Conditions 1.1) Matching of file names && Multi-condition name matchingYou can use regular expressions to match, and-a or-o in

Shell combat: Get column content in a variety of ways

I am not a professional Linux, usually do not work in Linux programming, self-learning some Linux shell programming, forget to learn, learn to forget, efficiency is not high. Today is the right to review it.Think of a scenario where you get a

CentOS assigns IP script--The first shell script written

IDC small rookie one, non-trained. There are often customers with CentOS servers that need to allocate 15 IPs or even 30 IPs. Each time a manual assignment was cumbersome, it took a day to learn the shell script and write the

Write Ngin startup script with Shell

#!/bin/bash[-f/etc/init.d/functions] &&. /etc/init.d/functionsPid=/application/nginx/logs/nginx.pidNginx=/application/nginx/sbin/nginxRed_color= ' \e[1;31m 'Green_color= ' \e[1;32m 'Yellow_color= ' \e[1;33m 'Blue_color= ' \e[1;34m 'pink= ' \e[1;35m '

Shell writes Ngin startup script

#!/bin/bash[-f/etc/init.d/functions] &&. /etc/init.d/functionsPid=/application/nginx/logs/nginx.pidNginx=/application/nginx/sbin/nginxRed_color= ' \e[1;31m 'Green_color= ' \e[1;32m 'Yellow_color= ' \e[1;33m 'Blue_color= ' \e[1;34m 'pink= ' \e[1;35m '

Shell Script debugging

Bash is the default scripting language in a Linux system, and since it is a programming language, debugging of scripts is essential. Here's a simple debugging approach to bash:1 using Bash's parameter-X, such asBash-x a.sh+ for A in ' bafa{1..4} '+

A shell script for an automated deployment

Tag:conf    start failure     Path    kill   jar    web    automation    history   webapps    #!/bin/bash### #just for autodeploy## #author: zgniu######## #定义项目路径 ######## #item_war_dir = "/home/v2/tomcat8080/ Webapps/server-mobile-web "########

Case commands in the shell

The case statement and the judgment statement [If...elif...else] function similarly;When logic is relatively simple, the code is much less than the latter.Case usage, use a variable to match a value, if the match succeeds, execute the command below

Shell Basic Syntax 2

Automated deployment and monitoring of development scripts1. Scripting automatic deployment of reverse proxy, web, NFS;Requirements: I, the deployment of Nginx reverse proxy three Web services, scheduling algorithm using weighted polling;II, all Web

Shell Learning Notes Collation (ii)

Special characters:#! Sign of the beginning; Delimiters with multiple commands together[Email protected] log]# echo A;echo b;echo CABC. Multiple functions:1. Equivalent to the source command2. As part of the file name (hide filename) (use ls-a to

Shell Script Execution

Method One: Switch to the directory where the shell script executes the shell script:cd/data/Shell. /hello.shThe./means to execute hello.sh under the current working directory. If you do not add./,bash may respond to an error message that could not

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

Total Pages: 541 1 .... 458 459 460 461 462 .... 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.