Shell scripts regularly back up the database

Script code:New File back_db.sh #!/bin/Bash Todaytime="' Date +%y%m%d '"DBNAME="test MySQL"Dumppath="/usr/local/webserver/mysql/bin/mysqldump"HOST="XXX"USER="XXX"PASSWD="XXX"Db_file="/home/data/backup/db_$todaytime.sql.gz"

Using Sqlplus in shell and debugging related

Five, for security requirements each execution of the shell manually entered the password$ VI test5.sh#!/bin/bashEcho-n "Enter password for u_test:"Read PASSWDSqlplus-s/nolog Conn u_test/$PASSWDSELECT * from tab;ExitEof$ chmod +x

Write your own shell command more

Simple implementation of the more commands under Unix:#include #define Pagelen 24#define linelen 512int do_more (file * file); int see_more (file * file); int main (i NT Argc,char * argv[]) {FILE * fp;if (argc = = 1) do_more (stdin); Else{int

How many parameters can a shell enter?

During scripting, input to parameters is usually involved. For example, SH 1.sh 10 20, in the execution of 1.sh this script, 10 is the first parameter, 20 is the second parameter. Sometimes there is this confusion about how many variables can a

A new line break for files created under Windows ^m causes the shell script under Linux to run the wrong solution

Files that are often edited under Windows are sent to Linux remotely, ^m at the end of each line, which causes the shell script to run incorrectly, mainly because the editor under dos and the editor under Linux are inconsistent with the carriage

Shell comparison and judgment

Comparison and judgment are the elements of program flow control. This article summarizes shell comparison and judgment statements for ease of searching and using. 1. Important comparison Operators Greater than:-GT Less than:-lt Greater than

Shell BASICS (8)-cyclic statements

   国庆过后;感觉有点慵懒些了;接着上篇;我们继续来学习循环语句。     一. for循环         与其他编程语言类似,Shell支持for循环。 for循环一般格式为:for 变量 in 列表do command1 command2 ... commandNdone    列表是一组值(数字、字符串等)组成的序列,每个值通过空格分隔。每循环一次,就将列表中的下一个值赋给变量    例如,顺序输出当前列表中的数字 for01.sh$ cat for01.sh

Shell judgment and Comparison

1  shell 的$! ,$?, $$,[email protected]   $n        $1 the first parameter,$2 the second... $#        The number of command-line parameters. $0        The name of current program. $?        Last command or function‘s return value. $$   

How to Implement tomato work using shell

#! /Bin/sh # program description # scripts for implementing the tomato working method # tomato working method rules # Rule 1: A tomato lasts for 30 minutes, including 25 minutes of work and 5 minutes of rest. # Rule 2: the time of a tomato is

HDU 2446 shell pyramid (Binary Search mathematics)

Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2446 Problem descriptionin the 17th century, with Thunderous Noise, dense smoke and blazing fire, battles on the sea were just the same as those in the modern times. but at that time,

Shell script tracing and debug

Shell script tracing and debug Before scripts runs, the most feared problem is the syntax error! So how can we debug it? Is there a way to determine whether there is a problem without directly running the scripts? Haha! Of course! Let's take the

"Peanut shell" + "visualsvn" cleverly implement remote code version control

Recently, as the project requires remote access to the svn server, but there is no fixed domain name or IP address, we plan to use a peanut shell to apply for a free domain name to build a server, and then deploy visualsvn on the server, you can

Shell temporary notes

-EQ equals -Ne is not equal -GT greater -Ge is greater than or equal -Lt is less -Le is less than or equal   SEQ 1 30 numbers from 1 to 30 Touch-mt2010030303.03 $ dir: Modify the directory time format STAT/tmp/1.dir view the modification time Lines

Summary of the For Loop in Shell

There are a lot of for loop usage in shell. I always want to summarize it. Today I saw a summary of for loop usage on the Internet, which is very comprehensive. So I will turn to research and study... 1. For (I = 1; I 2. Commonly Used in shell is

Shell Boolean operation

1. The true and false values in bash are not the values 0 and 1 we generally think. True and false are built-in shell commands that return logical values. For example: $ True $ Echo $? 0 $ False $

What is the difference between <and> shell learning?

Tag: ShellStrictly speaking, Because 0 is the default value of > This method is used to export data to a file. If the file does not exist, the file is created. If the file exists, the file is cleared. Generally, this method is used when we back

Shell Command sorting

1. Echo Parameters -N does not wrap (default line feed) -E makes the transfer character valid Example Ss = 'abc \ n' echo-e $ ssabc # echo $ ssabc 2. When assigning values = do not include spaces on both sides A = "hello" # error A = "hello" 3.

Use getopts in Shell

[[Email protected] shell] # Cat getopts. Sh #! /Bin/bash # Date = 2014-09-16 # Is to practice the getopts While getopts "A: BC" Arg (: The preceding variable must follow the parameter) Do Case $ ARG in A) Echo "A's Arg: $ optarg" ;; B) Echo "B" ;; C)

Shell to view the basic information script of the system

Shell to view the basic information script of the system #! /Bin/bashecho "IP:" ifconfig | grep "inet addr" | grep-v 127.0.0.1 | awk '{print $2}' | awk-F ': ''{print $2} 'echo" Product Name: "dmidecode | grep Nameecho" CPU Info: "dmidecode | grep-I

Basic Regular Expressions and shell Regular Expressions for Linux shell Programming

Basic Regular Expressions and shell Regular Expressions for Linux shell Programming Fast query of Linux commands and Shell programming examples Covers common Linux commands, including Shell script programming syntax, text processing

Total Pages: 541 1 .... 434 435 436 437 438 .... 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.