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"

The shell is broken and read

1. How the string is converted to uppercase and lowercaseStr= "This is a Bash Shell script."1> TR Modenewstr= ' TR ' [A-z] ' [A-z] ' 2> typesetTypeset-u VARIABLE (convert VARIABLE lowercase to uppercase)Typeset-l VARIABLE (convert VARIABLE uppercase

Shell Programming for Linux

I've been studying this Linux shell program recently because I'm interested in this Linux system, so I've learned the shell programming at once.In fact, this Linux shell programming is a summary of the execution of this overall command, that is, if

Write your own shell command ls-r1ff

The r parameter of the LS command represents the recursive listing of all files in all subfolders, 1 means that each row displays only one file or folder, and F means that the output is not sorted, and F indicates that the output of each item is

The experience of Shell scripting in development

The experience of Shell scripting in developmentThis period of time in the development of a program, program output has a lot of logs. Sometimes you need to log to analyze the problem of the error. Separate viewing efficiency is too low to analyze

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

Shell while loop

The while loop is used to continuously execute a series of commands and to read data from the input file; the command is usually a test condition. The format is: while Command Do If True done The command finishes, control returns to the top of

First shell script

Open a text editor, create a new file, the extension sh (sh for Shell), the extension does not affect the execution of the script, see the name is good, if you write a shell script in PHP, the extension is good with PHP.Enter some

A few common shell

As mentioned above, the shell is a scripting language, so there must be an interpreter to execute the scripts.The common shell scripting interpreters on Unix/linux include bash, sh, csh, Ksh, and so on, which are used to call them a shell.we often

Shell Basics (ix) function

function allows us to divide a complex function into several modules, which makes the program structure clearer and the code reuse more efficient. Like other programming languages, the Shell supports functions as well. The Shell function must first

Batch Create user (Shell command) under Linux

The first method:Using Shell to create users in bulk, divided into 2:1, batch-created user names are irregular; 2. batch-created user names are regularFirst, the shell of the user name that was created in bulk is irregular:First, the user names that

Differences in Unix shell (), [] and [[]]

Tag:http   io   os    use     file    sp    div   2014   amp    The difference between the Unix shell (), [] and [[]]   1. First of all, although very similar, but conceptually, they are different levels of things. "[[" is a keyword, and many

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

Bash reads and writes shell Variables

Special characters Purpose Description $ Variable Get the value of a variable. If it is not initialized, It is null. Returns the value of "variable". If it is not initialized, null is returned. $

Shell text filtering programming (11): paste command

Tag: script [Copyright statement: reprinted. Please retain the Source: blog.csdn.net/gentleliu. Mail: shallnew at 163 dot com]It can be seen from the literal that the paste command and the cut command have the opposite function. The cut command

Shell BASICS (8)-cyclic statements

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

Use of IF Statements in Shell

#! /Bin/sh # Determine whether to use a positive or negative number based on the entered number. Path =/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin:/usr/local/sbin :~ /Bin Export path Echo "Enter the number \ n" Read shuzi If [$ shuzi-GE 0];

Shell (Shellshock) vulnerability repair

cve

Shell (Shellshock) vulnerability repairShell (Shellshock) vulnerability repair Background: More than two weeks have passed since the outbreak of the "Shellshock" Vulnerability (announced on April 9, September 24, 2014 ). I believe many people have

Raspberry Pi Shell script file

Raspberry Pi Shell script file Commands can be combined and saved in a file for execution. In a silly example, copy the following command to your favorite Text Editor: While 1 doecho Raspberry Pi! Done Now, save it as a file named fun-script.

Shell upgrade,/bin/bash versions 4.1 to 4.3

Shell upgrade,/bin/bash versions 4.1 to 4.3 Bash environment variables have arbitrary code execution vulnerability: "Using CGI requests can cause remote code execution, which in turn leads to server intrusion, causing serious harm,Patches officially

Total Pages: 541 1 .... 393 394 395 396 397 .... 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.