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 ' #

Linux Shell Common directives

1. Man helps explain commands you are familiar with or unfamiliar with Eg:man ls to view LS-related usage Note: Press the Q key or CTRL + C to exit, under Linux you can use CTRL + C to terminate the current program run. 2. LS to view the

Color Ball of shell scripts

The first thing to know is how to play color ball: 6 red balls (1~33) and a Blue ball (1~16) to choose a so-called 6+1To generate 6 random numbers between 1~33 and cannot be equal, this is key if you use traditional judging methods (the first with

Shell Batch Decompression method

First:For tar in *.tar.gz; Do tar xvf $tar; DoneFor tar in *.tar.bz2; Do tar xvf $tar; DoneSecond: Bulk unzip all tar.gz files in a folder with the tar commandLS *.tar.gz | Xargs-n1 Tar XZVFThird: find-maxdepth 1-name "*.gz" |xargs-i tar xvzf {}This

Shell script-Backup According to the number of files (reprint)

#!/bin/bash############################### #FileName: Backuplogtimer.SH#Function: Scheduled backup log file #version:0.1#Authon: xueya#date:2014.06. -############################### #获取当前路径path=`pwd`Echo "current1 path: ${path}"#循环执行 while[[1-eq1 ]]

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

How the shell generates RPM package warehouse list file comparison results

Basic steps:1. Switch to the warehouse directory Rpm_list_dir1 and RPM_LIST_DIR22. LS lists the RPM package files of the warehouse and redirects them to the output files Rpm_list_file1 and Rpm_list_file2 respectively.3. Output the comparison results

Casing conversion in Shell

There are two ways of doing this:1, with TRExample: uppercase=$ (echo $VARIABLE | tr ' [A-z] ' [A-z] ') (convert VARIABLE lowercase to uppercase)lowercase=$ (echo $VARIABLE | tr ' [A-z] ' [A-z] ') (convert VARIABLE uppercase to lowercase)2, with

The progress bar and maximum minimum average under the shell

Progress barC Language progress bar reference my original article blog-> progress barFunction proc () {     i=0      str= '       arr= (' | ')   '/'   '-'   ' \ \ ')      index=0     while [   $i  -le 100 ]     do          printf  "[%-101s][%d%%][%c]

Shell 2 Tetris

      declare -i noar= (1 1 1 1); Br= (1 1 1  1 1 1 1 1 1 1    1 0 0 0 0 0  0 0 0 1    1 0 0 0 0 0 0 0 0  1    1 2 0 0 0 0 0 0 0 1     1 0 3 0 0 0 0 0 0 1    1 0  0 4 4 5 0 0 0 1    1 0 0 0 0  0 0 0 0 1    1 1 1 1 1 1 1 1  1 1) echo  "[][]|" echo  " 

Basic job of Shell script

1, write script/root/bin/systeminfo.sh, display the current host system information, including host name, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size.#!/bin/bash# author:huiping# version:1.0.1# date:

Parentheses and instances in a shell script

1, single parenthesis and double parenthesisThe double parenthesis command allows advanced mathematical expressions to be put into a comparison. The format is as follows:((expression))In addition to the standard mathematical operators used by the

The meaning of the shell script's own variable

The file name of the shell itself $1~ $n Each parameter value added to the shell. $ $ is the 1th parameter, and the $ = is the 2nd parameter ... $$ the shell itself PID (ProcessID) $! PID of the Shell's last running background process $?

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" line-by-row processing of text files

"Shell script" line-by-row processing of text filesThe style files are often processed on a line-by-row basis, how to get each row of data in the shell, then process the row data, and finally read the next row of data, loop processing. There are

How to let awk use Shell variables under Linux

How to let awk use Shell variables under LinuxWhen we write shell scripts, we typically include other small programs or commands in the script, such as awk operations. For awk , we need to find some way to pass some values from the shell to the

Hill sort (shell) theory---does not contain source code

|  Copyright Notice: This article for Bo Master original article, without Bo Master permission not reproduced.Hill sort, is a narrowing incremental sort. It is sorted according to the step size, different steps may produce different sequences, but

Shell Array Common operations

1. See the script for details#!/bin/bash# declaring an array declare -a test#j=0#cat > test.file 2. Implementation results[[Email protected] ~]# sh a.sh 1 2 3 4 5one A-print all of the array elements12345another A-to-print all of the ARR Ay elements1

Total Pages: 541 1 .... 417 418 419 420 421 .... 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.