Database backup, remote execution shell script

Little stuff, for database backup.Retained.#!/bin/SHkeepdays= -currenttime=`Date "+%y-%m-%d-%h-%m"' Backpath="/sql_bak/"DbName="Smdb"Echo${currenttime}/usr/bin/mysqldump--default-character-set utf8-u xxx--password=xxx--database ${dbname} >${backpath}

1.2 Shell variables

#系统变量Env View System Variablesecho $HOSTNAME View variable contentsSet view system environment variables, also display user-defined variables, compare all#用户自定义变量a=1;b=2 Defining variablesecho $a $b output variable value#引用变量执行结果Myvim= ' which vim '#

Linux Shell wildcard character (globbing)

A wildcard is handled by the shell, and it appears only in the parameters of the command (it is not used in the command name or on the operator). When the shell encounters a wildcard in parameters, the shell treats it as a path or file name to

Intra-enterprise network segment detects how many hosts live--shell scripts

Intra-enterprise network segment detects how many hosts are alive1) byPingLifeorder to achievePing-c 1-w 1 IP- C: indicates the numberof times , 1 is 1- W: represents deadline, time out , in seconds,1 for 1 seconds. Note: a) If one goes to ping to

Shell script to GG

==================================================#!/bin/bashsqlplus=sqlplus64username=$1psswd=$2filedir=$3[[$ Filedir] | | Filedir= "/sandbox/edf_api_repo_dir" [[-D $filedir]] | | {echo "mkdir $filedir"; mkdir $filedir; chmod 777 $filedir;} [-D

2. Shell's shell configuration file

1. Location of shell configuration files The most commonly used shells are SH and bash, which only speak sh and bash here. 1.1. SH (Bourne Shell) configuration file has two main, respectively, each user home directory

Linux Shell Common Tips (directory)

Linux Shell Common Skills (i)Http://www.cnblogs.com/stephen-liu74/archive/2011/11/10/2240461.htmlI. Special documents:/dev/null and/dev/ttyTwo. Simple command trackingThree. Regular expression basic Syntax descriptionFour. Use the Cut command to

Shell monitoring Tomcat (three) port is normal

#!/bin/bash#by lc#protnum= ' netstat-lntup|grep java |wc-l ' [email Protected]tomcat_prot () {if [' Netstat-lntup|grep Java |wc-l '-ne 9]then clear Echo-e "\033[31m############################################\033[0m" Echo-e "\033 [31m#\033[0m "" \033

Shell scripts for quick deployment of Tomcat projects

In order to do cluster testing, 3 tomcat is installed on each machine, each time the project is released, it is necessary to repeatedly knock some commands, check that the Tomcat process has not stopped before restarting Tomcat, and kill the process

Shell script-Quick Arrival Directory

The server contains many engineering directories, SSH login, need to manually knock command, very troublesome, can establish automatic login script1, the server logon is the default directory in the creation of script files   VI drivers.sh

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

1, Reason analysis:No. Bash_profile This file can be displayed by configuring this file recovery path.2. Configuration steps:(1), Vim ~/.bash_profile Add the following command here:Export ps1= ' [\[email protected]\h \w]\$ '(2), after saving to

Shell conditions and loops

A If statementif [expression]ThenElif[expression]ThenElseFiNote: There should be a space before and after expression;Then you can start another line, or you can go with the if peers, to add '; ' ;Two Case modeCase Value inMode

shell< two >

1. you want to download a software from the server, your machine has two network cards eth0 and eth1, the address is configured as follows:Eth0 : 192.168.6.25/24Eth1 : 172.16.101.25/24 default gateway: 192.168.6.1/24 server address:211.138.18.3

Shell Programming for Linux

Basic knowledge of Shell programmingThree ways to empty a log1.echo Cary >test.log>test.log2.echo Cary >test.logEcho >test.log3.echo Cary >test.logCat/dev/null >test.logShell scripts are good at working with plain text type data, while almost all

Shell Learning notes-Shell variables

First, the name of the variableThe variable name must begin with a letter or underscore, consisting of a letter, number, or underscore, and the variable name cannot exceed 255 characters in length.Ii. Classification of variables1. User-defined

Shell reads text content

In Linux there are many ways to read a file row by line, the most common is the method in the following script, and is the most efficient, most used method. In order to give you an intuitive feeling, we will test the execution efficiency of various

Batch renaming with Shell

Batch Create files first#!/bin/shif [!-d/tmp/Chenyao]then mkdir /tmp/chenyao-p fi /tmp/Chenyao for in {1.. Ten }do touch chenyao-$i. html doneBatch Renaming[Email Protected]amp scripts]# cd/tmp/chenyao/[email protected]

Summary of Linux endpoints and Shell

Early computers because you understand the reason there are multiple physical terminals (by connecting the port of the computer what to achieve), here the terminal is the I/O device. The computer itself, which is inherently an I/O device (not an

Linux Shell Learning notes--file test characters

1. File Test Actions----------------returns True if ...-e file exists-a file has the effect of this option with-e is the same. But it has been deprecated and does not encourage the use of-Ffileis a regular file (not a directory or device file)-s

Shell strings and Arrays

String:1. Single quotes:str = ' value 'Single-Quote String restrictions:Any character in a single quotation mark is output as is, and the variable in the single-quote string is not valid;Single quotation marks cannot appear in single quote strings

Total Pages: 541 1 .... 366 367 368 369 370 .... 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.