In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to back up Nagios mysql. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The Nagios mysql backup script is as follows:
#! / bin/bash
Date= `date +% Y% m% dudes% H% M`
BACK_PATH=/opt/data/var/nagios_bak
FILE1=nagios_etc_$date.tar.gz
FILE2=mysql_bakcup_$date.sql
Tar-czf $BACK_PATH/$FILE1 / opt/nagios/etc 1 > / dev/null 2 > / dev/null
Cp $BACK_PATH/$FILE1 / data/var/.
Mysqldump-uroot-ppasswd db > / data/var/$FILE2
Scp $BACK_PATH/$FILE1 monitor2:/opt/data/var/nagios_bak/. 1 > / dev/null 2 > / dev/null
Ssh monitor2 "rm-rf / usr/local/nagios/etc/" 1 > / dev/null 2 > / dev/null
Scp-rp / usr/local/nagios/etc monitor2:/usr/local/nagios/. 1 > / dev/null 2 > / dev/null
Ssh monitor2 "chown-R admin.admin / usr/local/nagios/etc/;/etc/init.d/nagios restart" 1 > / dev/null 2 > / dev/null
Write the script to crontab after Nagios mysql backup
Add a sentence
1 * / 2 * / home/admin/bin/backup_nagios.sh
Thank you for reading! This is the end of the article on "how to back up Nagios mysql". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.