Shell script automatically frees up space script in Linux

System: CentOS 5.xScript content: The code is as follows Copy Code Cat make_room.sh#!/bin/bash#size = ' Df-hp|grep/dev/mapper/volgroup00-logvol00|awk ' {print $} ' |cut-f 1-d ' G 'Size= ' Df-mp|grep/dev/mapper/volgroup00-

Example of shell concurrent programming in Linux

In Python, there are many modules that enable concurrent programming, such as threading, processing, Eventlet, and Stackless python. So how does it work for the shell? In fact, the principle is very simple, I used the method is:1. The tasks that

Linux shell script completes SVN version library

Every time you build a new SVN version of the library it's always a lot of fun, so write a section of the script to automate the process, the detailed code is as follows: The code is as follows Copy Code #!/bin/bash# by

Shell script Migration Compression package in Linux

The original script: The code is as follows Copy Code #!/bin/bashFile= "/root/newfile/"List= "/root/sqlbak"Ls-l $list/|awk ' {print $} ' |while read lineTodoCp-r $list/$line $fileDone Modified script:

Linux shell command to monitor whether the iptables is running

Script content: The code is as follows Copy Code VI iptables-reset.sh#!/bin/bash#Powered by blog.slogra.comport= ' Iptables-vl|grep Ssh|awk ' {split ($NF, A, ":");p rint a[2]} ' |wc-l 'if [$port = 1];thenecho

Description of use of regular expressions in Shell if

The IF statement in the shell needs to make a regular judgment and check the grammatical records. The code is as follows Copy Code Datepattern= "^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$"if [["$STARTDATE" =~ $DATEPATTERN]] && [[

The use and skill of shell commands in Linux

Using the Linux shell is my daily basic work, but I often forget some useful shell commands and L tips. Of course, I can remember the order, but I'm not sure I can remember how to use it to perform a particular task. So I began to record these

Shell Bulk Delete directory under specified directory

Take. SVN example For example, if I want to delete all the. SVN directories under/data/web/, then execute the following command. The code is as follows Copy Code Cd/data/webFind. -type d-name ". SVN" |xargs RM-RVF

Shell loops process daily data in Linux

A date loop that is useful in processing some data that is stored by date. Especially testing and recording, deleting, reprocessing data. However, if you encounter a situation such as the span of a month, simply using a numerical cycle is not

Shell-init:error Retrieving current directory Solutions

Renamed a Web project, and then modified the Apache configuration to a new directory restart, the following error message appears: Shell-init:error Retrieving current Directory:getcwd:cannot access parent directories:no such file or directory

How to unpack under Linux. tar.gz. tar.bz2 command _linux Shell

The most common source package downloaded from the network is. tar.gz package, and part of the. tar.bz2 Package To decompress is simple: . tar.gz Format Decompression command for TAR-ZXVPF xx.tar.gz. tar.bz2 Format Decompression command for

The substitution of several basic commands in a shell script under Linux _linux shell

Part 1: ' Command ' This is the "command standard output as a function of standard input" method of operation, there are great drawbacks and unsafe places. disadvantage one: relatively old. disadvantage two: easy to confuse with single quotes.

Linux shell path intercepts regular expression _linux shell

Recently write script, need to intercept the path parameter that function passes in the script, discover the following more useful method, record below: File=/dir1/dir2/dir3/my.file.txt We can replace each of the different values with ${}: ${file#

Linux Makefile and Shell issues _ server Other

Presumably, anyone who knows makefile knows that makefile can invoke a shell script. But when it's actually used, it's not that simple, and some ambiguous places can make you mad. If you don't believe it, you can take a look at a few examples,

The command to be memorized in git summary _linux shell

Submit Process Related View file changes and new files Add new File git add Your_file_path //Add all Files git add * //Add a type of file Simple submission of files Submit all of your modified files and

Shell Contact 2

See if there are any custom users (ordinary users) on your Linux system, and if so, how many are there?[email protected] ~]# cat 6.sh#/bin/bashN= ' awk-f: ' $3>=500{print '/etc/passwd |wc-l 'If [$n-gt 0];thenecho "$n Common users"Elseecho "No common

Start shell script for Nginx service in centos

Nginx service startup script  The code is as follows:Copy code #! /Bin/sh# Chkconfig: 2345 55 25# Description: Startup script for nginx webserver on Debian. Place in/etc/init. d and# Run 'UPDATE-rc. d-f nginx defaults', or use the appropriate

Prevent ssh Brute-force cracking of shell scripts in Centos

Script#! /Bin/bash Cat/var/log/secure | awk '/Failed/{print $(NF-3 )} '| sort | uniq-c | awk' {print $2 "=" $1;} '>/root/black.txt # filter the ip addresses and times in the Failed status Cat/var/log/secure | awk '/Invalid user/{print $ NF}' | sort |

In CentOS, the Web server's CPU load exceeds the threshold and the shell script is automatically restarted.

Note: Operating system: CentOS Web server: apache Problem: Search engine crawlers increase website access volume in a certain period of time. The server is under heavy pressure, the website access times out, and the page cannot be

Total Pages: 541 1 .... 416 417 418 419 420 .... 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.