Using the shell to back up sites and databases

bz2

#/bin/bashbackupath=/opt/backup/webpath=/usr/local/apache2/htdocs/Date= ' Date +%y%m%d 'webbakfile=web${date}.tar.bz2dbfile=db${date}.tar.bz2Dbuser= ' Root 'Dbpassword= ' 123 'ftpserver=192.168.1.107Ftptargetpath= ' Ftp/backup 'CD $WebPathPwdTar jcf

Linux_ some shell command analysis records

I. Interface command interaction for shell scriptsecho "Please enter Css-dist:"Read Addcssecho "Start downloading the zip package for CSS"(wget $addcss) >>/dev/nullThe above is equivalent to:(wget http://****************-bin.zip) >>/dev/nullThe

Using shell scripts to filter inaccessible nodes in Hadoop

Recently used a cluster HP1, because the maintenance of the cluster of people do not give force, the node always over a period of time dropped one or two. When Hadoop was restarted today, HDFs was in protected mode.decided to filter out all the

The use of some shell symbols

Give you a full, you in the Linux environment to try to understand more:The execution name of this program$n the nth parameter value of this program, n=1..9$* all parameters of this program, this option can have more than 9 parameters.$# the number

Shell Programming Basics Case Exercise

First, the grammar Case inch " content of the first variable " # Each variable content is suggested in double quotation marks, the keyword is parentheses) # execution content ;; # Use two consecutive semicolons to handle each

Bash Shell Process Control--select

Preface today just wrote an automated packaging script, again using the bash shell, a good feeling of happiness. The main point here is to introduce the Select command, which can help us to complete the menu selection function.Format I am also the

Linux shell scripting

Linux shell scripting:1. Program Structure Exercise: Write a script, given a positive integer, to calculate the sum of all digits of this number.For example, if the program is given input 123, it should return 1+2+3=6.2. Program Structure Exercise:

Two ways to invoke/reference/include additional script files in the shell

Script First (test example 1) #vi first.sh 1 #!/bin/bash 2 echo   ' your is in first file ' q) Call another script file in the current script file? Method One: Use sourceScript second (test

Shell Test Expression

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4D/83/wKioL1RSSRHxRte-AAFhU-dm6eA664.jpg "style=" float: none; "title=" test1.jpg "alt=" Wkiol1rssrhxrte-aafhu-dm6ea664.jpg "/>650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4D/83

Analyzing statistical logs using shell commands

The user log information needs to be counted, when the user behavior is analyzed, the shell can often easily take out a lot of data, and then put it in Excel.For example: The statistics log contains loadcustomprocess This address of access, by

Shell Programming Basics of Select Exercise

First, the grammarSelect inch con1 con2 con3 # automatically lists Con1,con2,con3 's selection menu do #执行内容break # Select itself is a loop, Break is when you choose to jump out of the loop done Second, practice Select + Case Emulation

Instructions for redirecting <<eof in the shell

IamlaosongWe often use the Sqlplus EMSSXJK/EMSSXJK The SQL statement is equivalent to the input in the Sqlplus program environment, so that the input content is sandwiched between two eof, can be long and short, EOF can also be replaced by any other

Shell script Executive Times "bad Interpreter:text file Busy" workaround

When executing a shell script, a "-bash:./killsession.sh:/bin/bash:bad interpreter:text file Busy" error message is encountered, as follows:[Email protected] bin]$./killsession.sh-bash:./killsession.sh:/bin/bash:bad interpreter:text file busyAt this

Write your own shell command of LS

The C language implementation of the LS command under Linux (supports the-R parameter):#include #include #include #include #include #include #include void Do_ls (char *), void Do_stat (char *,char *); void Show_ File_info (char *,struct stat *,

Shell judgment file and path

#!/bin/sh Filepath= "/users/xxx"Filename= "/users/xxx/xxx"#这里的-x parameter determines whether $mypath exists and has executable permissionsif [!-X "$filePath"]; Thenmkdir "$filePath"Fi#这里的-D parameter to determine if $mypath existsif [!-D "$filePath"

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

Shell variables and shell Variables

Shell variables and shell Variables Suppose we define a variable:File =/dir1/dir2/dir3/my.file.txt You can replace $ {} with different values:$ {File # */}: Delete the first/and its left string: dir1/dir2/dir3/my.file.txt$ {File ### */}: Delete the

Shell condition judgment

Shell condition judgment1. if condition judgment: if [condition]; then do something fi multiple conditions: & represents AND | represents OR multiple judgments: if [condition]; then do something elif [condition 2]; then // do something else // do

Shell acronyms and judgment symbols []

Shell acronyms and judgment symbols []1. The test command is used to detect the file type and compare values. Determine whether a file exists: [work@www sh]$ test -e file.txt && echo "exist" || echo "not exist" not exist[work@www sh]$

Use shell commands to analyze statistics logs

Use shell commands to analyze statistics logs When you need to collect user log information and analyze user behavior, you can use shell to conveniently retrieve a lot of data and place it in excel for statistics. For example, for access with the

Total Pages: 541 1 .... 433 434 435 436 437 .... 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.