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

Use of case in shell scripts

The case selection statement in the shell script can be combined with the read instruction to achieve a good interactive response operation, case receives one or more parameters passed in by the read instruction, and then the case is selected

Shell Process Control Statements

Case statementcase $变量名 in "值1") ? 如果变量的值等于值1,则执行程序1 ;; ?"值2") ? 如果变量的值等于值2,则执行程序2 ;; ? ...省略其他分支... ? *) ? 如果变量的值都不是以上的值,则执行此程序 ;;esac ?//case反过来写"case语句的使用实例"#!/bin/bashread "please input yes /no": chocase "$cho" in "yes") ? ? echo "输入正确!";; ?"no"

Linuxday8--shell Script Programming Basics

VariableA variable is a named memory spaceAll variables in the shell are treated as character variables by default, and bash does not support floating-point variablesNaming rules for variables:You cannot make a reserved word in a program: for

[Shell] Swoole_timer_tick and crontab for scheduled tasks and monitoring

There are three main steps to completing tasks and monitoring manually:1. mission_cron.php (timed automatic task script):2. Mission_cron_monitor (run by crontab, monitor the above script):#/bin/bash# Monitor the timer and disconnect the reboot. # #

Shell's enterprise practical work case

Case one:Monitoring Web Site Directory ( /var/html/www ) If all files are tampered with (the contents of the file have been changed), if there is a file name (e-mail) to print the changes, the scheduled task every 3 minutes to execute onceMonitoring

cannot be deleted after entering with hbase shell in Xshell

The issue cannot be removed after using HBase shell entry in Xshell:In the HBase shell, the wrong input instructions can not be deleted using backspace and delete, the use of the people know that this is a lot of pits, there is much distress!OK,

Explanation of Bash Shell terminal in Linux

Shell: is an outer layer of the kernel Protection tool, and is responsible for the completion of user-to-kernel interaction;Provides an interface for users to interact with the kernel, which receives commands entered by the user and sends it to the

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

Rote memorization in the shell

One, the shell quotes1. "", double quotation marks (do not retain the full content, such as encountered $, anti-quotes, \ etc will execute the corresponding shell)echo "Today is `date`" -> Today is Wed Aug 2. Single quotation mark (full retention

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

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 Script Programming Learning notes-branching and looping structures

1.1 If statement(1) If conditional statement syntax: Single branch structureif [condition]ThenInstructionsFiOrif [Condition];thenInstructionsFiIf single branch condition Chinese programming Image grammarIf [you have a room]SoI'll marry you.Fruit

Shell Script Programming Learning notes-file test expressions

1.1 How to use a file to test an expressionWhen we need to process an object in programming, we need to test the object and only take action to meet the requirements. The benefit of this is to avoid program errors and to consume system resources

Shell instance: Back up all modified files in the last day

Backs up all modified files in the current directory within the last 24 hours in a "tarball" (Files that have been processed by tar and gzip).The program code is as follows:#!/bin/bashBACKUPFILE=backup-$(date +%y-%m-%d)#

Shell Script Rman Backup

#!/bin/bashif [$]thenbackup_level=$1elsebackup_level=0fibackup_user=sysbackup_user_pw=oracle#catalog_user=rman #catalog_user_pw =rmanlog_file=/oracle/admin/$ORACLE _sid/rman_backup.logecho "Beginning rman backup ..." > $log _ filedata>> $log

Shell: Working with text

There is the following text, where the first 5 lines of content are1,111,111:13,443,253,4562,222,222:13,211,222,1221,111,111:13,643,543,5443,333,333:12,341,243,1232,222,222:12,123,123,123After processing with the shell script, output in the

Enterprise Shell interview Case (top)

Mass production of random character filenamesRequirement: Use the For loop to create 10 batches of HTML in the/oldboy directory. Each of these files needs to contain 10 random lowercase letters plus a fixed string of Oldboy.#!/bin/bash[!-d/oldboy] &&

What is the use of the shell after $ after quotes ($ "string" and "string")

Sometimes in some service management scripts to see the $ "$string", after some tests, found that the outside of the quotation marks is the same as No. Just turned the man bash and found an explanation.(1). If there is no special custom bash

Total Pages: 541 1 .... 315 316 317 318 319 .... 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.