In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you the "Linux system how to configure files simple shell backup script", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "Linux system how to configure files simple shell backup script" this article.
In computer science, Shell, commonly known as shell (used to distinguish it from kernel), refers to software (command parser) that "provides the user with an interface". It is similar to command.com under DOS and later cmd.exe. It receives user commands and then invokes the appropriate application.
Online configuration files and application configuration files are very necessary to back up, do not rule out friends who can go to the server without backup directly modify errors or other personnel misoperation. Now it takes ten minutes to simply write a backup script, and you can also add other backup scripts yourself.
Although simple, but with this thing is still a lot of relief, no longer have to worry about the original configuration file can not be found.
#! / bin/bash# bakup configfile for system 、 nginx 、 php 、 ELK and so on#author:21yunwei#date:2017.4.22time= `date +% Y% m% d`LOGFILE = / backup/configbak/configbak.log [!-e / backup/configbak/elkbak/$time] & & mkdir-p / backup/configbak/elkbak/$time [!-e / backup/configbak/nginxbak/$time] & & mkdir-p / backup/configbak/nginxbak/$time [!-e / backup/configbak/phpbak/$time] & & mkdir-p / backup/configbak/phpbak/ $time [!-e / backup/configbak/etcbak/$time] & & mkdir-p / backup/configbak/etcbak/$time function etcbak () {tar zcf / backup/configbak/etcbak/$time/etc$time.tar.gz / etc/*} function nginxbak () {cp-rfpu / usr/local/nginx/conf/* / backup/configbak/nginxbak/$time/} function phpbak () {cp-rfpu / usr/local/php/etc/* / backup/configbak/phpbak / $time/} function elkbak () {cd / backup/configbak/elkbak/$time & & mkdir es logstash kibanacp-rfpu / usr/local/ELK/elasticsearch-5.1.1/config/* / backup/configbak/elkbak/$time/es/cp-rfpu / usr/local/ELK/logstash-5.1.1/config/* / backup/configbak/elkbak/$time/logstash/cp-rfpu / usr/local/ELK/kibana-5.1.1/config/* / backup/configbak/elkbak/ $time/kibana/} # start bak working:etcbaknginxbakphpbakelkbak#bakwork end ret=$?FINISHTIME= `date +% Y% m% dwells% H% M% S` [$ret-eq 0] & & echo "configbak finished Time:$FINISHTIME "> > $LOGFILE | | echo" configbak failed,please check time:$FINISHTIME "> > $LOGFILEfind / backup/configbak/-type d-mtime + 15 | xargs rm-rf is all the contents of the article" how to configure a simple shell backup script for files on a Linux system " Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.