Shell script code for backing up site content _linux Shell

Back up Web site content Copy Code code as follows: #!/bin/bash #指定运行的脚本shell #运行脚本要给用户执行权限 Bakdir=/backup Month= ' Date +%m ' day= ' Date +%d ' Year= ' Date +%y ' Hour= ' Date +%k ' min= ' Date +%m ' Dirname=

Simple analysis of how to use script to automatically send text mail mail _linux shell under Linux

1. Install MSMTP luther@gliethttp:~$ sudo apt-get install msmtp 2. Edit the configuration script (~/.MSMTPRC is the default profile, or you can specify the profile path using the-C option) luther@gliethttp:~$ Vim MSMTPRC #添加如下内容 Defaults #logfile/

A method instance for canceling redirection in a shell script _linux shell

In the previous example of Shell programming, it was mentioned that the shell script was extended and redirected to a file for viewing and debugging http://www.jb51.net/article/62435.htm. However, if there is another situation: redirect only in some

Shell Implementation TR Delete replacement detailed _linux shell

The TR (translate abbreviation) is used primarily to remove control characters from files or to convert characters. Syntax: TR [–c/d/s/t] [SET1] [SET2] #SET1: Character Set 1;set2: Character Set 2-c:complement, replace the characters except SET1

Shell script Implementation deletes a year ago file feature sharing _linux shell

Copy Code code as follows: #!/bin/bash #Description: Delete Files #===== defines the current year, the month, and the directory where the file resides =====# Currentyear= ' Date +%y ' Currentmonth= ' date +%m |awk-f ' 0 ' {print $} '

Introduction to the position variables of special variables in shell programming _linux shell

1. Get the file name of the current script, including the path. Copy Code code as follows: #写一个测试脚本 Vim test.sh #内容如下 Dirname$0 Basename$0 #执行一下 bash$ (PWD)/test.sh #输出如下 /home/jane test.sh 2. $n get the

Shell create user and generate random password script share _linux shell

To create a random number method: Copy Code code as follows: 1~~~~ /dev/urandom In Linux, a device/dev/urandom is used to generate random sequence of numbers. Using this device we can generate random strings when needed.

The shell implements the "multithreading" Execution script file perfect solution _linux Shell

For example, I have 100 executable files, there is no special relationship between each other, such as code: Copy Code code as follows: Job_1 Job_2 Job_2 ..... job_100 Want to use Csh/bash to multithreading call

Two ways to encrypt shell scripts under CentOS _linux shell

The first method (Gzexe): This type of encryption is not a very safe method, but can satisfy the general encryption use, can conceal the password in the script and so on information.It is the use of the system's own Gzexe program, it is not only

Shell monitoring script preparation work sharing _linux shell

1 Prepare the monitoring machineLinux system, normal server can, request:Install SSH client, if you want to send SMS, also need to prepare SMS cat and install Gnokii or Gammu 2 Edit ssh_config configuration file/etc/ssh/ssh_config configuration

Shell script code Summary for the detection process _linux shell

A simple shell script to find out if a critical service is running and is suitable for Linux or UNIX operating systems.The script can also send notifications using e-mail. Code: Copy Code code as follows: #!/bin/bash #

Linux Modify directory and file permissions simple command to explain _linux shell

Problems encountered today, how a user such as WWW permissions replicated to my users? Permissions for the directory representation: dwrxr--r-- Where the first character d represents the directory,-representing the character w is writable, and R

The shell script _linux shell that retains the specified number of files under Linux under the file system

The content of this section:Keep the specified number of files remaining under the file system Example: Copy Code code as follows: #!/bin/bash #------------------------------- #Description: Back Up your files #site: Www.jb51.net #--

Understanding and learning of shell programming Basics Bash_linux Shell

1. Understanding Bash Through the shell will input the instructions and kernel communication, let kernel control hardware workView Shell:cat/etc/shellA preset shell type is recorded in the/etc/passwd after login and is related to the accountCommand

Shell script implements illegal IP login automatic alarm _linux shell

The security and stability of the server is the goal that every operational dimension wants to achieve, after all, once the site traffic is big, visit high, there will be some boring people to attack, to help detect the loophole is good, but the

Shell script implements simple split string _linux shell

We have such a string: Copy Code code as follows: info= ' ABCD;EFGH ' Now to get ABCD and efgh, we can simply use the cut tool to get: Copy Code code as follows: Fstr= ' echo $info | cut-d \; -F 1 ' Sstr= ' echo $info |

Two methods of changing passwords interactively in shell scripts _linux shell

Today, when writing a shell script to find that you need to set the user's password, and set the password is interactive, so in the script is obviously not very good, so the Internet to find data, found the following two common way to set the

method to get the absolute path of the script's directory in the shell _linux shell

To get the absolute path of the executing program/script itself, you can use DirName (Realpath (__file__) in PHP, and C # has System.Windows.Forms.Application.StartupPath; Java does not seem to have any more direct method, can only use Codesource to

The shell script implementation finds the last occurrence of a character in a string _linux shell

You need to find the last position of one of the characters in the string, which is available in PHP (Strrpos) or Perl (Rindex), and you can't think of a way out of the shell. Post on the Forum also no one answer (do not know whether the problem is

Shell script implementation detects if a process is running _linux shell

Here is a brief description of a bash script that you wrote to detect if a process exists. directly on the code. Copy Code code as follows: #!/bin/bash ps_out= ' Ps-ef | grep $ | Grep-v ' grep ' | Grep-v $ ' result=$ (echo $ps _out |

Total Pages: 541 1 .... 359 360 361 362 363 .... 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.