Shell regularly backs up database information

#!/bin/SH# DatabaseInfoDb_user="batsing"Db_pass="BATSINGPW"Db_host="localhost"db_name="Timepusher"# Others Varsbin_dir="/usr/bin"#the MySQL bin Pathbck_dir="/mnt/mysqlbackup"#the Backupfiledirectorydate=`Date+%F ' #

(vi) write a first shell

1, editor, compiler, Run method (3 ways to execute the script)(1) Shell program is text format, as long as the text editor can be. But because our shell is running under a Linux system, the line break must be ' \ n ' and the line break under Windows

Bash Shell common shortcut keys

Some of the more commonly used bash shell commands are listed below for forgetting.For detailed commands, please refer to: https://github.com/LinuxTOY/linuxtoy.org/blob/master/content/bash-shortcuts.mdView history Commands:Up and Down keysCommand

Implementation of shell Multi-process

Requirements: Multiple scripts do not interfere with each other and run simultaneously, saving timeRookie level implementation:#!/bin/shDir= "/data/test"$dir/sbin/test1.sh >>$dir/log/test1.log 2>&1 &$dir/sbin/test2.sh >>$dir/log/test2.log 2>&1 &$dir/

function calls in the shell

What to learn in this chapter---------- Function Introduction---------- function Definition---------- function uses---------- differentiate return and the Exit---------- Delete a function---------- Precautions1. Introduction function  When you

Zookeeper under the shell operation

Zookeeper under the shell operationEnter%zk_home%/binperform zkcli.sh [-server Ip:port] #如不指定, then connect the nativeCreate:create [-S] [-e] path data ACL #创建数据节点-----s indicates that the sequential node-e represents a temporary node, and two are

Eval in the shell

Eval syntaxEval arg1 arg2 ...The function of Eval is to take the following parameters Arg1 Arg2 and so on as a pipeline, and then re-execute the shell process pipeline (about pipeline, see http://www.cnblogs.com/chaoguo1234 /p/5724321.html)Suppose

Shell Learning Note 2

First, Shell special variables1. Position Variables Positional variables Meaning $ Gets the file name of the currently executing shell script, including the script path $n Gets the nth

Shell script Programming--case statements

What I'm sharing for you is how to use case statements to write some scripts that you choose to execute. Case statements are mainly adapted for use in some complex selection of scripts, if we use if multi-branch statements can also be written out,

Shell Learning notes-the first day

1. The first line of the program specifies the program that executes the shell  #!/bin/sh #! is used to tell the system that the parameter behind it is the program used to execute the file2. Output information in the consoleecho "Hello

Shell script Programming (i)

One, bash variables:Variable naming laws:1. The reserved words in the program cannot be made: for example if, for;2, only use numbers, letters and underscores, and cannot start with a number3. See the meaning of the name4, the Uniform naming rule:

Shell script Programming--if statements

How to handle the programming logic:1, sequential execution2, select Execute3, loop executionConditional Select if statementSelect Execute:Note: If statements can be nestedSingle Branchif judgment condition; thenBranch code with true

Shell script exercises Basic Article 2

Practice  2, write a script/root/bin/yesorno.sh, prompt the user to enter Yes or no, and determine whether the user entered Yes or no, or other information   #!/bin/bash #   case $1 in   yy]| [YY] [EE] [Ss])          echo  "You  put a $1"            

Regular expression of the Linux--shell script

First, the concept and characteristics of regular expressions:A regular expression is a logical formula for a string operation, which is to make a "rule string" with a predefined set of characters and a combination of those specific characters.This "

Progress bar---shell script implementation

1. Procedure650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/85/99/wKiom1epjIzSGVmbAABUg44vkDo770.png-wh_500x0-wm_3 -wmp_4-s_3200651285.png "style=" Float:none; "title=" Captures 1. PNG "alt=" Wkiom1epjizsgvmbaabug44vkdo770.png-wh_50 "/>2.

Shell loops, simple little exercises

1. The array is full of positive integers greater than 0, using the shell to find the maximum, minimum, and average values (2 decimal places reserved)650) this.width=650; "src="

Hadoop HDFs Shell

1. View HelpHadoop fs-help 2. UploadPaths on files > such as: Hadoop fs-put test.log/3. View the contents of the filePaths on Hadoop fs-cat such as: Hadoop fs-cat/test.log4. View File listHadoop Fs-ls/5. Download the filePaths on Hadoop fs-get 6,

Bash Shell Basics

Bash a few common code######## #最简单的bash#! /bin/bash #解析器路径 env #查看环境######### #看运行时间#!/bin/time. SH start=$ (date +%s) #commands; #statements; Sleep Ten ; #command End=$ (date +%s) Difference=$ ((End-

The IF variable in the shell contains a string in the judgment

Reference:Http://bbs.chinaunix.net/thread-1633281-1-1.htmlDemand:The "/data/cache" string is sufficient in the cache_dir of the judging variableAct 1:if [["${cache_dir}" =~ "/data/cache"]; Then echo "true" fiAct 2:if [[${cache_dir} = */data/cache*]];

HDU 5730-shell Necklace

Test instructionsGive a continuous coloring method of 1-n beads A[i] (1Analysis:The DP equation can be obtained: Dp[n] =∑ (i=1,n) (Dp[n-i]*a[i]).The equation is convolution form, so CDQ + FFT  CDQ: Will [L,r] two points, first get [L,mid] answer,

Total Pages: 541 1 .... 464 465 466 467 468 .... 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.