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

There are a couple of egg-ache problems when writing hive SQL and shell scripts!

Error One:The alias of the field cannot be used after Hive's where,Error Two:A custom function cannot be used in Hive's groupby, otherwise an error (replaced with a nested select)Error Three:When executing: $./hive_game_operationstatis5.sh, 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:

[In Linux]shell, the application of the anti-quote (')

The anti-quote bit (') is located above the TAB key of the keyboard, to the left of the 1 key. Note the difference between the single quotation mark (') on the left side of the ENTER key.Anti-quote bit (') plays the role of command substitution in

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

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 the shell command yourself

The Linux Write command allows users to talk to users on other terminals. Implement the shell command write in C, with the following code:#include #include #include #include #include #include #include #include #include char *

Write your own shell command du

The du command can view the number of tiles occupied by the specified folder, and the following is the code for the C language implementation of the Shell du Directive under Linux (Support-k option):#include #include #include #include #include

Linux Shell startup configuration file Settings

Installation of a software, the final generated report, requires "to start using the EGSNRC system, activate your current configurationBy adding the following lines to your favorite shell resource file: "At first I didn't understand what the shell

Shell Send mail

Bin/mail (BIN/MAILX) uses local sendmail to send mail by default, the local machine must install and start the SendMail service, the configuration is cumbersome and unstable.You can use an external SMTP server to send messages by modifying the

Shell Programming Notes

#! /bin/shLook for Shell interpreter/bin/sh is a path#! /usr/bin/pythonJust looking for a Python interpreter.How to run a Linux program:Allow files to run directly with executable permissionsInvoke interpreter to executeUse Source to performThe

Write your own shell command more

Simple implementation of the more commands under Unix:#include #define Pagelen 24#define linelen 512int do_more (file * file); int see_more (file * file); int main (i NT Argc,char * argv[]) {FILE * fp;if (argc = = 1) do_more (stdin); Else{int

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

who writes the shell command himself

Idea: There is a file named Utmp in the UNIX system that contains information about the user currently logged in to the system. Utmp This file holds a structure array, and the array element is the structure of the utmp type. To implement the WHO

Linux Shell Multithreaded Programming

#!/bin/bash# ——————————————————————————— – #  This example illustrates a technique for simulating multithreading with the wait, read command  #  This technique is often used for multi-host checks, such as SSH login, ping and so on, this single

Shell BASICS (8)-cyclic statements

   国庆过后;感觉有点慵懒些了;接着上篇;我们继续来学习循环语句。     一. for循环         与其他编程语言类似,Shell支持for循环。 for循环一般格式为:for 变量 in 列表do command1 command2 ... commandNdone    列表是一组值(数字、字符串等)组成的序列,每个值通过空格分隔。每循环一次,就将列表中的下一个值赋给变量    例如,顺序输出当前列表中的数字 for01.sh$ cat for01.sh

Use of IF Statements in Shell

#! /Bin/sh # Determine whether to use a positive or negative number based on the entered number. Path =/bin:/sbin:/usr/bin/:/usr/sbin:/usr/local/bin:/usr/local/sbin :~ /Bin Export path Echo "Enter the number \ n" Read shuzi If [$ shuzi-GE 0];

HDU 2446 shell pyramid (Binary Search mathematics)

Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 2446 Problem descriptionin the 17th century, with Thunderous Noise, dense smoke and blazing fire, battles on the sea were just the same as those in the modern times. but at that time,

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 to view the basic information script of the system

Shell to view the basic information script of the system #! /Bin/bashecho "IP:" ifconfig | grep "inet addr" | grep-v 127.0.0.1 | awk '{print $2}' | awk-F ': ''{print $2} 'echo" Product Name: "dmidecode | grep Nameecho" CPU Info: "dmidecode | grep-I

Total Pages: 541 1 .... 378 379 380 381 382 .... 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.