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

The difference between $ (()) in the shell and $ () and ${}

$ () and ' (anti-quote)In the bash shell, $ () and "(anti-quote) are used for command substitution.$ echo the last Sunday was $ (date-d "last Sunday" +%y-%m-%d)Get the date of the previous SundayThe reason for using $ () ' (anti-quotes) is

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 Automation Installation Lamp

(a) Installation ideas(1) Source code compile Apache WEB Service(2) Source code compile MySQL DB service(3) Source code compiled PHP WEB service(4) Lamp Source Integration +php page creation(5) Optimization of shell scripts, introduction of

Shell after class summary

Shell after class summary High wavesArchive: Learning NotesDecember 4, 2017 13:31:08 Shortcut keys:Ctrl + 1 title 1Ctrl + 2 title 2Ctrl + 3 title 3Ctrl + 4 ExampleCtrl + 5 Program CodeCtrl + 6 Body Format

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

Function of Shell programming

First, function definition and invocationA function is a series of commands that are customized in a shell script, and generally the function should have a return value (returning 0 correctly and returning a non-0 error). For error returns, you can

Shell Multi-Process scripting

#!/bin/bashPython_path=/home/huaw/Crawlerpython_name=list_all_v6_crawler.pymax_sync_process=40Echo"Max allowed Ic_stat_company_submit process is $MAX _sync_process"Current_sync_num= ' Ps-ef|grep $python _name | Wc-l |grep-v grep ' current_sync_num=$[

Linux command----Shell

Shell: The command interpreter executes the corresponding command according to the command entered.See which shells are under the current system:Cat/etc/shellsView the shell that is currently in use by the systemEcho $SHELLCommon shell/bin/sh "has

Linux5.4 Shell special symbols and piping related commands

Special Compliance 1. * Any of the characters 2. ? Any one character 3. # comment Character 4. \ de-semantic character 5. | Pipe character 6. The $ variable prefix, which represents the row bit 7. ; Multi-line command line input, split with

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

Use the SED command in the shell to replace/\/

SED command Related:Https://www.cnblogs.com/ggjucheng/archive/2013/01/13/2856901.htmlHttps://www.cnblogs.com/DragonFire/p/6600121.htmlHere we have to do the function is:Enter a directory "/data/data8"Transform it to "\/data\/data8" in the shell

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 loops and traversal

Enter parameter traversal########## [email protected] indicates a parameter string#!/bin/bashecho [email protected]For i in [email protected]; DoEcho $iDoneSelf-incrementAs far as I know, in bash, there are currently five ways to do this:1. i= '

Shell file permissions and script execution

I. Rights Management1. View file propertiesLs-l2. Permission TypeIi. Linux Users and permissions1. User Management① Viewing usersID User1② adding usersUseradd user1③ Deleting a userUserdel-r user11. User Group① New GroupGroupadd G1② Deleting a

Shell automatic backup Deployment New Project (2)

Optimized scripts for automatic backup, automatic restart of Tomcat#!/bin/bashnew_war= "Mobile.war" project_name= "tomcat-app1" #创建临时文件夹tempDirName = ' date ' +%y%m%d%h%m%s ' tempdirname= "Bak/mobile-${tempdirname}" echo "Ready to create Temp folder:

Introduction to Shell Array usage

Introduction to ArraysBash provides only one-dimensional arrays, and does not qualify the size of the array. Similar to the C language, the subscript of an array element is numbered starting with 0. Gets the elements in the array to take advantage

Shell (awk) array use case

1. Take the IP address of the ifconfig eth0[Email protected] ~]$ ifconfig eth0Eth0 Link encap:ethernet HWaddr 00:0c:29:68:47:71inet addr:192.168.48.144 bcast:192.168.48.255 mask:255.255.255.0Inet6 ADDR:FE80::20C:29FF:FE68:4771/64 Scope:linkUp

Windows automatically uploads and executes Linux-specified shell files

Install Putty.exe, the following EXE files are installed in the installation directoryCreate File Put-file-mobile.txtRM Mobile.warput D:\SVN_LZY\dragon-tour-2_1\lzy-mobile\target\mobile.warexitCreate a batch file release-mobile.batPsftp.exe [email

Total Pages: 541 1 .... 338 339 340 341 342 .... 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.