Shell script automatically backs up the database

#!/bin/bashdb_user= "root" db_passwd= "dddddd" db_name= "Mmmmmm" Cd/db_backupecho "You is in Bakmysql directory Now" Backup_dir= "/db_backup" #时间格式time =$ (date+ "%y+%m+%d") #mysql备份命令mysqldump-u$db_user-p$db_passwd $db _name > "$ backup_dir/$db

Shell Script Basics (vi)

First, alarm system mail engine[[email protected] mon]# lsbin conf log mail shares[[email protected] mon]# cd mail[[email protected] m ail]# vim mail.py//Create send mail script #!/usr/bin/env python#-*-coding:utf-8-*-import os,sysreload (SYS)

Lesson 22nd Basics of Shell

First, Shell introduction1, the shell is a command interpreter, providing users and machines to interact, each user can have their own specific shell,2, CentOS7 default shell for bash, and Zsh,ksh they have the difference in detail,We can check if

Daily Shell Exercises (04)

1. ExercisesDesign a script that monitors the surviving state of a remote host (assuming the IP address is 110.110.110.114) and sends a message to yourself when it finds an outage.Tips: You can use the ping command: ping -c 10 110.11

Shell Test Judgment command

Judging command testYou can use the test command to perform tests on files, strings, and so on, typically with control statements such as While,if,case"字符串测试" ? test str1==str2 测试字符串是否相等 ? test str1!-str2 测试字符串是否不相等 ? test str1 测试字符串是否不为空 ? test -n

Linux shell scripts How to create a user with several looping statements

Hello everyone, I am the lone cloud twilight rain, brought to you today is the "Linux shell script several circular statements to create the user's method"Add USER1~USER20 UserFor loop:#!/bin/bashfor i in {1..20}douseradd User$iecho ' user$i Users

Shell Entry Notes (i)

Shell IntroductionDuring the development process, the Linux system is frequently contacted and used, and the shell is a bridge for our users to use Linux, and is a program written in the C language. The shell is a command language, as well as a

The logical operators for Shell script programming

1. Logical operators;Logical operator Instances:A=Tenb= -if[$a! =$b]then Echo"$a! = $b: A! = b"ElseEcho"$a! = $b: a = b"fiif[$a-lt --A $b-GT the]then Echo"$a less than 100 and $b greater than 15: Returns True"ElseEcho"$a less than 100 and $b greater

Special variables for Linux shell programming

$ A This is the path to the script file itself (relative path)If there is an execution script file under the current directory, you cannot write an absolute path for execution.$# this variable to record the number of input parameters6 is the number

Shell scripts to install the NTP Server service

############################# #Deploy NTP server ########################Echo "start deploy NTP server" Yum Install-y NTPif[!-f/var/log/ntpd.log]; Then Touch/var/log/Ntpd.logfi Chownntp:ntp/var/log/Ntpd.logCat$basepath/package/ntp.conf

Introduction to "shell" Linux shell functions

Linux Shell functions Write in front: function, this word in just the beginning of the classmate looks very tall, in fact, the shell inside the function is very simple, function is actually to reduce the amount of code, so this space may be

Have finished the shell, write a little script to show you

In Linux has been learning for one months, today to write a small script, wrote three different, although simple, but you can see, I wrote the script is ping3 times to see if the host is alive!The first one is ~ ~ for~~ loop because I knocked it

Use of shell special variables

$ Current PIN name$# the number of arguments passed to the scriptThe first parameter, and so on$*,[email protected] All parameters$$ Current Shell Process IDShell output shell name, PID, number of parametersList parameters in sequence#!/bin/bashecho"

Linux Learning Notes (25) Shell special symbols, Sort_wc_uniq, tee_tr_split

one, special characters 1.Any character of ' * '‘? ' Any one character' # ' comment characters' \ ' de-semantic characters' | ' Pipe characterMost of them have been used before, for the caret ' \ 'Examples of the use of the caret2. Several

Commands and special symbols in the shell

1. Record the command:!!! : Continuous "! "indicates that the last instruction was executed! N: Represents the second instruction in the execution of the command historyNote:! 2 actually shut me down.! String (string greater than 1) indicates the

Shell exercises (eight)

Exercise 1: Monitoring disk usageRequirements: Write a shell script that detects all disk partition usage and inode usage and logs to a log file named after today's date, and notifies you when a partition capacity is found or the Inode usage is

Shell Script View Linux system performance bottlenecks (RPM)

Shell Script View Linux system performance bottlenecks (go to: http://blog.51cto.com/lizhenliang/1687612)[[email protected] ~]# cat show_sys_info.sh #!/bin/bash#os_check () {if [-e/etc/redhat-release]; then redhat= ' cat/etc/redhat-release |cut-d

Full-Library hot backup of shell scripts

#!/bin/bashbackup_dir=/oracle/backuplog_file= $ORACLE _base/admin/$ORACLE _sid/hold_backup_$oracle_sid.logecho   "Backuping cold backup"  > $log _filedata>> $log _filesqlplus -s /  As sysdba > $log _filealter database backup controlfile to   '

Shell Learning Notes

First, Shell discussionSecond, the script execution modeCreate and open a shell scriptVim Hello. SHEdit#!/bin/Bash#-E allows echo to support Shell escape character echo"\e[1;34m First shell script \e[0m"Run#赋予权限, running (common) chmod 755 Hello. SH

Linux Bash Shell Basic syntax

The use and setting of a variable (note that there can be no spaces before and after the equals sign)1. ReadRead the input from the keyboard assignment to the variable, using the following method[Email protected]:/opt/android-sdk/sdk/# read

Total Pages: 541 1 .... 535 536 537 538 539 .... 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.