Demand:
Daily 2:10 back up the database zhengdb to/data/backup/db.
The start and end of the backup can give the appropriate information.
The backup file identity standard is the backup time as the file name, and packaged into a. tar.
Variable setting rules1. Variable names can consist of letters, numbers, and underscores, but cannot begin with numbers;2, in bash, the default type of the variable is a string, if you want to do numeric operations, you must specify the variable
Shell script:
A text file that contains some commands or declarations and conforms to a certain format
Format requirements: First line shebang mechanism
#!/bin/bash
#!/usr/bin/python
#!/usr/bin/perl
The
scene: In peacetime work, often need to perform some scheduled tasks, and when the timing of the failure to perform tasks need to come to the nail group, using the [nail robot] can easily and quickly help us do this thing.
Simple to use
Five, Shell Process Control1. A heavy BranchIf statement syntax format:If conditionThenCommand1FiThe FI at the end is the if inverted.Write a line:if condition; Then Command1; Fi2. Two branchesIf ELSE syntax format:If
Learning about Linux, some time ago to learn the shell script, wrote a very simple script, remote other virtual machine to partition the disk, their own pure hand, but also a record of individual learning process, the great God can skip!Here is the
Lab Environment:System: centos7-3.10.0-x86_64Testing Services: apache-tomcat-9.0.7Experimental reasons:Because the current environment for the Java test environment, so did not monitor, but recently found that the service is automatically down, and
Shell Special Symbol Cut command* * indicates wildcard characters?? represents an arbitrary character# #号注释字符, the annotated content will not take effectThe \ \ symbol denotes the caret character, leaving the special symbol out of the original
A 1.shell programming language is a dynamic language (a weakly typed language) that interprets side execution at run time, does not need to be declared before it is used, is declared in use, and does not even differentiate between variable types,
Shell and shell scripting differencesShell: Refers to an application that provides an interface through which the operating system kernel services can beShell script: A script written for the shellExecution of Shell scriptsPass./execute instead of
$: The file name of the current execution script$n: N is the natural number, the first parameter is $ A, the second argument is $, and so on$#: Number of parameters$*: All parameters, a string, for example,./a.sh 1 2 3, then $* is "1 2 3"[Email
One: Shell introductionThe shell is a command interpreter that provides interaction between the user and the machine, supports specific syntax, and each user can have his or her own specific shell,centos default of bash, and Zsh,ksh.Two: Command
Turn from: Https://www.cnblogs.com/vijayfly/p/6234575.htmlshell redirect standard error output to a different locationThe following forms of command invocation can often be found in some scripts, especially when Crontab is called:/tmp/test.sh
The shell script has strict rules for spaces, and there must be no spaces on either side of an assignment statement, and a string comparison with spaces on both sides of the equal signWhen assigning: I=1i=$ ((i+1))//= must not have spaces on both
Special symbols in the 1.linux shell(1) "*" represents 0 or more arbitrary symbols(2) "? "represents only one arbitrary symbol(3) "#" comment Description, "#" after the content will be ignored(4) "\" caret character, "\" After the special symbol
1. (1) Change the main prompt to the user's home directory name (hint: reference material 4.6.8 section environment variable PS1 and HOME usage)(2) Assign the string DOS file c:>\ $student \* to the variable x and display it (hint: note the choice
In shell programming, it is often necessary to determine the status of a file, whether the string is equal, and two numeric values, and then perform the related operations based on these comparisons. This paper mainly describes the file status,
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.