Nodejs a timed call to the shell script to back up the database and log files and send them to the mailbox

install MAILX, rely on it to send mailyum install mailxEditing a configuration filevim /etc/mail.rc #添加如下内容set [email protected]set smtp=smtp.163.comset [email protected]set smtp-auth-password=xxxset

(reproduced) Shell script exercises

#!/bin/bash #Write a script#1. Set the value of the variable file to/etc/passwd#2. Say hello to each user in/etc/passwd and say what the ID is.#shaped like:#Hello,root,your UID is 0. FILE=/etc/passwd COUNT= ' Wc-l${file}| Cut-f1-d" "` forIinch'

Shell Learning Locate and find commands

There are several commands on the Linux system for file search, such as: Locate,wheris and find are more commonly used in work.1.locate command: Locate the lookup file is based on the/var/lib/mlocate database, which contains all the local file

Basic Shell Command 1

1. List of files and directories 1.1 more common Linux top-level virtual directory names and their contents: Directory Use / The root directory of the virtual directory. Files are not usually stored here

Shell Script Basics (i)

First, Shell script introduction The shell is a program written in C that is a bridge for users to use Linux. The shell is both a command language and a programming language. The shell is a scripting language; Can use logic

Shell scripts: variables, file judgments, logical operations and other minutes

In the shell script, the variable definition, the reference each has the different way, in addition, very commonly has the file attribute judgment, the logical operation, the numerical operation and so on, the following record their attribute

Shell Programming Basics: logical Operations

Recently around here for a long time ah, now reluctantly come out, share a little understanding of their ownExit statusA program once run must have only two kinds of results, either success or failure, the result of success is the same, the reason

Shell scripting exercises may continue to append ~ ~ ~

1, write script/root/bin/systeminfo.sh, display the current host system information, including hostname, IPV4 address, operating system version, kernel version, CPU model, memory size, hard disk size#!/bin/bashecho "hostname: `hostname`"echo "ipv4

Centos7.2,shell script monitors CPU and SendMail auto alarm

Operating system: CentOS 7.2SendMail Automatic Alarm#完成时间: 2018.04.16#!/bin/bash#CPU 1,5,15###########################################################If [-e Detection_script]ThenMkdir-p/detection_script/Fi#############################################

Shell's service anomaly monitoring case

Example one: Web server Nginx Script service monitoring[Email protected]/server/scripts] #cat jiance_ng.sh#!/bin/bashif! Ss-lntup|grep [N]ginx &>/dev/nullThen/etc/init.d/nginx startecho "Nginx dead,but It's OK" |mail-s "WHW11" [email

The third of the shell

Chapter 1th whileLooping Statementsin a programming language , a while loop is a statement of a control flow that uses an expression that returns a Boolean value that, when the return value of the expression is true , repeats the condition of the

"Shell" Linux shell direct assignment and indirect assignment

What is direct assignment?1. The way the author directly assigns parameter values is called direct assignment.2. In general, an indirect assignment is assigned by an interactive method.Example 1:varl=arppinging.comThis is a direct assignment that is

Shell script Common script: For loop

 Shellscript Common script:ForLoopsWheil Many loops can be replaced with a for loopFor loop syntax structureFor variable name in variable Value listDoinstructionDoneFor ((EXP1;EXP2;EXP3))DoinstructionDoneScript instance:For 99multiplication

On the understanding and experiment of logical operation XOR in Shell programming

Logical operations in shell programming, with or without, short-circuit operations, XOR operations, we use the simplest way to understand the XOR.XOR: ^XOR two values, same as false, different for trueUnderstandably, two values refer to binary

Shell script (Learn note 1)

Shell Scripting Learning RecordWhy learn shell scripts?In some complex Linux maintenance work process, a large number of repetitive input and interactive operation is not only time-consuming and difficult, and error-prone, however, writing shell

Write a simple alarm system with the shell

Write a simple alarm system with the shell Create a directory structure mkdir -p /usr/local/sbin/mon/{bin,conf,shares,mail,log}mon //主目录bin //主程序目录shares //子程序目录mail //发邮件目录log //日志目录Program Main entry

Shell defines a template with variables, directly modify the variables, in this way no longer have to worry about the regular match is not allowed to the problem

Before using shell to write scripts, sometimes not only to define a configuration file, often have a template, different environments directly replace the same template content to use, however, until then, has been used in the SED, awk, grep and so

Shell exercise (Key-free login script)

#!/bin/bashremote_ip=$1if[!-N" $"] ; Then Echo "Please usage./without_password remote_host!"Exit1Else Echo "The remote_host you input is $remote _ip"fiSSH[Email protected] $remote _IP"mkdir. ssh; chmod. SSH"Ssh-keygen-t RSASCP~/.SSH/id_rsa.pub

Shell Scripting Learning notes-logical operators

1.1 The following table is a logical operatorTips:! Inverse: A logical value that is opposite to a logical value.-A Chinese meaning is with (&&): Two logical values are true return values are true, and vice versa is false.-O Chinese meaning yes or

Shell script Programming Shell array

1.bash supports one-dimensional arrays (multidimensional arrays are not supported) and does not qualify the size of the array(1) define an array:Array_name= (value0 value1 value2 value3)OrArray_name= (Value0Value1value2Value3)or individually defined:

Total Pages: 541 1 .... 244 245 246 247 248 .... 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.