Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zentao dual computer (database backup)

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

All the data of Zen Tao is stored in the database, so as long as the database is backed up, the entire Zen system is backed up. Let's share the backup shell you wrote:

#! / bin/bash DateNow=$ (date +% Y%m%d) BackupDir= "/ zentaoback/" BackupLog= "/ zentaoback/zentaoback.log" DataBase= "zentao" DBPasswd= "123" BackDir= "root@172.1.1.1:/zentaoback/" MysqlDump () {echo "$DataBase's DB back begin--- [`date +% Y-%m-%d/%H:%M:% S`]" > $BackupLog 2 > & 1percent & if [!-x `which mysqldump`]; then echo "No found mysqldump or No permit!" Exit 5else mysqldump-uroot-p$DBPasswd $DataBase > $BackupDir$DataBase$DateNow | | echo "mysqldump error!" & & / usr/bin/scp $BackupDir$DataBase$DateNow $BackDir > > $BackupLog 2 > & 1 steps & rm-rf $BackupDir$DataBase$DateNow > > $BackupLog 2 > & 1 steps & / bin/echo "$DataBase's DB back end--- [`date +% Y-%m-%d/%H:%M:% S`]" > > $BackupLog 2 > & 1 fiecho "> $BackupLog 2 > & 1} MysqlDump

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report