Rsync-linux backup script

Compile as script The basic form of this script is from the rsync website. In fact, there is only one command: Rsync-force-ignore-errors-delete-excluded-exclude-from = exclude_file-backup-dir = 'date + % Y-% m-% d'-av Key parameters are: -Backup:

Introduction to parameter passing methods in Shell scripts

1. $ # number of parameters passed to the script2. $ * display all parameter variables passed to the script with a single string. Different from location variables, this option can have more than 9 Parameters3. $ ID of the current process running

Shell script application and loop statements

Shell script application and loop statements 1. bash wildcard: 1 .? // Any single character 2. * // 0 or multiple characters 3. [] // any character in the interval 4.; // split the command, ignore the execution result of the previous command, and

Automatic shell disk monitoring

Cat disk. sh#! /Bin/bash For I in 'df | sed 1d | awk '{print $5}' | sed's/% // g'' ### compare the size of the obtained loop ### #DoIf [$ I-gt 10] ### here, the threshold value is set to 10 to facilitate testing ###ThenDf-lh> disk.txt was added to

View linux traffic code in real time

#!/bin/bash while["1"] do eth=$1 RXpre=$(cat/proc/net/dev|grep$eth|tr:""|awk'{print$2}') TXpre=$(cat/proc/net/dev|grep$eth|tr:""|awk'{print$10}') sleep1 RXnext=$(cat/proc/net/dev|grep$eth|tr:""|awk'{print$2}')

Regularly back up MySQL databases using shell scripts

Data backup is required for any online e-commerce site. Regardless of version updates or server migration, the importance of backup data is self-evident. Manual data backup not only consumes a lot of time and effort, but is not very professional. As

Monitor all vsftp actions and send an email to notify shell scripts

Wget http://cloud.github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz Wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz Wget http://inotify.aiken.cz/download/incron/incron-0.5.9.tar.bz2 Tar zxvf

Get CentOS Server Information shell script

This script has been tested on ubuntu and centos. The script is as follows: #! /Bin/bashLine = '============'# Linux release nameIf [[-f/usr/bin/lsb_release]; thenOS = $ (/usr/bin/lsb_release-a | grep Description | awk-F: '{print $2}' | sed's/^ [\ t]

Shell programming special variable -- location variable

Shell special Variables☞Location variable 1. $0 get the file name of the current script, including the path. # Write a test script vim test. sh # The content is as follows: dirname $0 basename $0 # execute bash $ (pwd)/test. sh # output the

Shell batch add users

It is said on the Internet that there was once a fast thunder pen question to add users in batches. The procedure is very simple. There is a small knowledge point. Set a password for the user without interaction. There are two solutions: 1. Reverse

Shell creates a user to generate a random password script

Method for creating random numbers 1 ~~~~ /Dev/urandom In Linux, a device/dev/urandom is used to generate a random number sequence. With this device, we can generate random strings as needed. For example, if we want to generate a random password

Shell game guess number

The generated password and user input can be repeated.Therefore, it may be much more difficult to guess general rules.Current version rules:A -- number pair, location pairB -- after excluding the result of A, the number is correct, but the position

A script that can detect the host type in the Network

Recently, I have been writing a script to automatically detect the host type in the network. The basic function can be used to determine the host operating system type. If the host is in the domain, you can obtain the host hardware and performance

Implement 'multithreading 'in shell'

That is, for example, I have 100 executable files and there is no particular sequential execution relationship between them, as shown in figure CODE: job_1job_2job_2.....job_100Want to use csh/bash for multi-thread invocation and execution For

Centos WEB server configuration Security

As we mentioned in the preface, although the Apache server is the most widely used, it is designed to be a very secure program. However, Apache also has security defects like other applications. After all, it is the full source code. The security

Shell obtains the network segment scripts of major carriers in China.

Asia Pacific Network Information is recorded here and updated every day. Http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest The script below will edit the text and output the CIDR blocks of several major carriers in China. #! /Bin/sh#

Shell: view the real-time traffic script of the NIC

#!/bin/bashwhile["1"]doeth=$1RXpre=$(cat/proc/net/dev|grep$eth |tr:" "|awk'{print $2}')TXpre=$(cat/proc/net/dev|grep$eth |tr:" "|awk'{print $10}')sleep1RXnext=$(cat/proc/net/dev|grep$eth |tr:" "|awk'{print $2}')TXnext=$(cat/proc/net/dev|grep$eth |tr:

PHP Website Security Settings on Centos Server

On average, PHP100 has intrusion or attacks every month. We have done a lot of work. Of course, many experts can still intrude into the PHP100. We are not surprised because we believe that there are people out of the world, although our servers are

Use shc's latest tool to encrypt Shell scripts

Use shc to encrypt Shell scripts to improve the security of shell script files.Introduction: When the shell script we write contains sensitive information such as the account and password, we want to enhance the security of the script, and do not

CentOS server Optimization

Preface: Server operation suggestions 1. Operate servers in strict accordance with directory specifications 2. remote servers cannot be shut down 3. Do not run high-load commands during server access peaks 4. Do not force yourself out of the server

Total Pages: 1330 1 .... 1101 1102 1103 1104 1105 .... 1330 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.