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}

Use the shell to import a certain format TXT file into the database via SQL load

1. Ready to work, window can directly import files through Sqlload, Linux, need to have sqlload related software.2. SQL Script (MID_DFDZ.CTL) LOAD DATAInto TABLE Mid_t0_transTruncateFields TERMINATED by ' |

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

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

Comparison of integer values in shell scripts

-eq: Equals-ne: Not equal to-GT: Greater Than-LT: Less than-le: Less than or equal to-ge: greater than or equal toCat File.txt | awk ' $ >= ' 09:03:00 "'How awk takes the reverseCat File.txt | awk ' $ >= ' 09:03 ' | awk ' {$2= ' ";p rint} 'Not the

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 Learning Notes

#表示该脚本以bash方式运行1. #!/bin/bash# accepts the input and assigns the value to the variable 2. Read variable name #使用变量3. ${variable name} #此变量只读4. readonly variable name #删除此变量, cannot delete read-only variable 5. The unset

Shell's Gollum installation + comment

#!/bin/bash#by lcpanduan () {if [ $? -ne 0 ]then  echo  "=========== ====$1 not ok ==================== "  exit 1fi}function checkroot () {   if [  ' Id -u '  -ne 0 ]  then     echo   ' pleases do this  ' su -"'  &&     exit 1   fi}function tarruby (

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

Shell script copies folder contents to another folder, and automatically backs up if it exists

Sometimes we need to overwrite a folder to our working directory, but need to automatically back up the existing files, one to go back to the backup is too troublesome, all the backup is not necessary. Shell scripts can do a good job of doing this.

Environment settings for the terminal of the Bash shell usage environment: stty

Environment settings for the terminal of the Bash shell usage environment: stty Environment settings for the terminal of the Bash shell usage environment: stty STTY-A Lists all the current stty parameters to INTR: Sending an interrupt

Shell handles files that contain spaces in the file name

Recently learning Gradle, using the git clone command to download some information, but the file name contains a space, it does not seem very comfortable, so think of using shell script to batch it, remove the file name of the space, note that this

Bash Series (1)--shell type

Login shell (requires a password) To log in normally through a terminal, you need to enter a user name and password.Using Su-usernameUsing su-l username Non-login shell (no password required) SU usernameOpen terminal window under

Shell Primer-WC

Command: WCOption:-L view number of rows-W View the number of words with a white-space character delimiter-M view number of characters, file sizeDescription: Counts the number of bytes, words, and lines in the specified file.-L[Email protected] 111]#

Shell Script Programming Basics

1. Create shell script file     Create file, add executable permission to file chmod +x file    format: Specify the shell        #! in the first line of the file /bin/bash    NOTES: #开头的命令 (except  #!/bin/bash  in the first line)     Display message:

Shell Redirection File Descriptor

#!/bin/bashRecently looking at the shell, a variety of puzzles, but to solve the feeling of confusion is still very good. Needless to say, Linux uses file descriptors to identify each file object. The file descriptor is a non-negative integer that

Conditional test in Shell

Condition test Type in Bash script: integer testString testFile testExpressions for conditional tests: [Expression][[expression]] expression must have a space before and after itinteger test :-eq: Tests whether two integers are equal and equal to

Shell Test Command

The test command in the shell is used to check if a condition is true, and it can be tested in three aspects of numeric, character, and file. Numerical test Parameters Description -eq Equals is True

Total Pages: 541 1 .... 313 314 315 316 317 .... 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.