System: CentOS 6.x
1. Install expect first
The code is as follows
Copy Code
Yum-y Install expect
2. Script content:
The code is as follows
Copy Code
Cat
Monitoring website 80 Ports
Many times we do not know whether the site 80 port is normal, of course, my previous Shell monitoring site status (continued) This article can also monitor the site, here is just to provide you with another way to
First, create test files test.sh
#!/bin/sh
./etc/profile
# Parameters:
# Args[0], data date, date format Yyyy-mm-dd
# Take 30 days before the date
function Get_date_ 30daysbefore ()
{
sec= ' date-d $ +%s '
sec_30daysbefore=$ ((sec-86400*30))
The AR command can be used to create, modify, or present a single module from a library. A library is a separate file that contains other files that are organized according to a particular structure (referred to as member of this library file). The
System Information
Processor architecture for arch display machines (1)UNAME-M processor architecture for display machines (2)UNAME-R Displays the kernel version being usedDMIDECODE-Q display hardware system parts-(SMBIOS/DMI)Hdparm-i/dev/hda lists
Own small website runs in the Aliyun ECS above, occasionally also analyzes own website server log, looks at the website the amount of visits. See if there's any black-and-wide sabotage! So collect, organize some server log Analysis command, we can
1 for statementSyntax formatFor variable in value (or loop condition)DoCommandDoneSend mail to multiple users#! /bin/bashDomain=163.comFor user in Tom Hom JemDoMail-s "Happy New Year" [email protected] $domain DoneTo print 9*9 multiplication
The following instance is used in the Centos6.5 64-bit operating systemOne, the regular copy fileA. Create the tomcatback.sh file in the/usr/local/wfjb_web_back directoryFile contents:#将tomcat中的应用wfjb_web copied to the/usr/local/wfjb_web_back/tomcat_
Every time I write a script under Linux has the ability to send mail, but the configuration under Linux always forget, so this time wrote a small script, record, next time you want to configure the script to run the line. QQ mailbox is used
First, demand analysis1. Log files are generated each day (the log files need to be uploaded to HDFs) 2. Analyze the fields included in the log file: Access IP, access time, access URL, access status, access traffic3. There are now "yesterday" log
Brief summary:Single quotes:What you can say is what you see is what you get: the contents of a single quotation mark are output as is, or what you see in single quotes is what you output.Double quotes:Output the contents of double quotation marks,
1.11.1 command SubstitutionUse the reverse quotation mark "'" (on the key of the wavy line) or $ () in Linux to perform command substitution. Generally more intuitive and more convenient to knock in $ (). [Email protected] tmp]# echo Can You tell me
Our company is through the Git+jenkins+shell+docker to achieve automated update release.Here I say how I use the SHELL+ATD service, at 21:00 in the evening to complete the lead account of a project on-line operation. Note that this on-line project
ls/usr/bin/The info# path Operation dirnamebasename# "" and "and" in the shell variable "" allows references to other variables by means of "" prohibit reference to other variables, as ordinary characters ' output of the command execution to the
1. Common environment variables
variable name
description
example
path
finds a collection of paths for all external commands. If you do not have a PATH environment variable, all external
1.1 Shell Script Writing specification 1.2 Variable and special variable application 1.3 Local variables and global variables 1.4 Test-piece expression ------------------------------------------------------ Background: In some complex Linux
There is a log file on the server Guest.log, each line contains: ID number, name, Internet café Name, the most recent Internet time, Internet hours, the amount of consumption, now requires the file of each row of the sixth column and the second
KVM One-click Shell automatically generates a Windows virtual machine, unattended operation scheme is divided into four steps to complete the joint;The first step: Start the startup script, so that the machine can be executed at the start of the
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.