Using the shell to automatically back up the database

#!/bin/sh#mysql Address # Detects if the user entered the password manually mysql_host= "" #mysql用户mysql_user = "" #mysql密码mysql_password = "#mysql数据库名 # If you do not fill in the database name you want to export the error message and terminate

Shell Script Programming Learning notes (iv) Shell operations database

First, the basic operation of the database1) Log in to MySQL server: mysql-u root-p password2) View database: Show databases3) View table: Show Tales from DB;4) View table structure: DESC table;5) Creating Table: Create table table ();6) View Table

Programming Basics for Shell scripts

Program: Instruction + dataProgram Programming Style:Program: command-centric, data-serving instructionObject type: Data-centric, instruction serves dataShell program: Provides programming capabilities to interpret executionHow to handle the

Shell Learning Notes

number of logged-in users: who | Wc-l See which users are logged on to the system : who Create a new file /bin/ct11, enter a command in the file,chmod Set the Execute permission for the file # cat >/bin/ct11W.H.O. | Wc-lPress Ctrl+d# Cd/

Shell Script Basics

Reprinted from Http://www.cnblogs.com/liyuhui-Z/p/7792108.htmlShell IntroductionAs a command language, the shell interprets and executes user-entered commands interactively, and as a programming language, it defines variables and parameters and

Shell script modifies all IP samples in Linux system

#!/bin/SHCurr_dir=$ (CD $ (dirname$0);pwd) Td_base=`su-Tduser-c"Echo"${td_base}""`functionchange_app_ip () {if[$#-ne3]; Then Echo "The Param is not correct."Exit1 fi if[" $"!="app_ip"]; Then Echo "The IP type is not

Shell echo Command

Shell echo CommandThe echo command of the Shell is similar to the echo command of PHP, and is used for the output of strings. Command format:StringYou can use echo to achieve more complex output format control.1. Display Normal string:" It is a test

Shell Basics and Programming specifications

One, Shell Environment View 1.1 View system shell support[Email protected] ~]# cat/etc/shells/bin/sh/bin/bash/sbin/nologin/ usr/bin/sh/usr/bin/bash/usr/sbin/nologin1.2 Viewing the current system default shellMethod OneEcho $SHELL/bin/bashMethod Two[[

Brother even Enterprise shell pen question 16-31

Enterprise Practice Question 16:Enterprise Case: Write Network Service standalone process mode rsync system startup scriptFor example:/etc/init.d/rsyncd{start|stop|restart}.Requirements:1. To use the System function library technique.2. To use a

Shell (i)

1. The idea before writing a scriptConsiderUnified Script ManagementPermissions: User execution permissionsEmpty the error fileError hintsScripting Versatility2.2 Unified Script Directory1 mkdir /server/scripts2 cd/server/scripts2.3 Creating a

CentOS Install fish Shell

For CentOS 7, run the following command with root user root :Cd/etc/yum.repos.d/wget Https://download.opensuse.org/repositories/shells:fish:release:2/CentOS_7/shells:fish: Release:2.repoyum Install FishFor CentOS 6, run the following command with

Input and output redirection in the Shell environment

Input and output redirection in a Linux Shell environment, denoted by symbols . 0, 1, and 2 represent standard inputs, standard outputs, and standard errors, respectively.1. redirect standard output to file: Cat fo > foo.txt2. REDIRECT standard

Shell Automatic Login Remote terminal

first look at the effect  What you need to do, configure the server information in the configuration file , Select the corresponding server , and make the connection. Traditional Manual ConnectionSSH [email protected] # then enter server

Shell Synthesis Example

Shell Synthesis Example (i)To back up the system configuration file:1, scheduled task service configuration file/var/spool/cron/root2. Boot from boot profile/etc/rc.local3, the Daily script directory4, Firewall iptables configuration

Linux under Shell display-bash-4.1# does not show path resolution

The path is not shown in the Linux shell, and it is inconvenient to use it as a-bash-4.1#.How do I change the shell to show the path?The steps are as follows:Vim ~/.bash_profile(No tube. Bash_profile This file has a few, you can create a new one is

How the date loops in the shell

First Kind# 这里的例子以周为循环!/bin/bashbegin_date="20160907"end_date="20170226"while [ "$begin_date" -le "$end_date" ];do year=${begin_date:0:4} week_of_year=$(date -d "$begin_date" +%W) echo $year, $week_of_year begin_date=$(date -d

Shell-based pipe characters and variables

Pipe characters and variablesOne, the pipe character and the job command1.txt |wc–l; Cat 1.txt|greap ' AAA 'The command for the pipe character is to give the result of the previous output to the following command2.ctrl z pause a task3.jobs viewing

Shell introduction, history commands, command completion and aliases, wildcard characters, input and output redirection

Shell IntroductionThe shell is the intermediate medium used when the system interacts with the computer hardware, and it is just a tool of the system. In fact, there is a layer of stuff between the shell and the computer hardware-the system

Linux Shell Programming

Shell Programming Concepts(1) Shell is a command-line interpreter, there are many kinds of shells(2) The shell as a bridge between the Linux kernel and the user, the user by default cannot directly manipulate the kernel(3) can be operated through

One shell per day (ii) Log IP statistics sorting

Statistical analysis of log files in the number of accesses per IP and sorted from high to low?Download the file to a local suffix#!/bin/bashawk? ' {print?$1} '? ip.log?|? Sort?|? Uniq?-c?|? Sort?-rn?|? MoreSh-x uniqip.sh?+ awk ' {print $} ' Ip.log+

Total Pages: 541 1 .... 347 348 349 350 351 .... 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.