禅道的所有数据都存在数据库里,所以只要备份好数据库就备份好了整个禅道系统。下面分享一下自己写的备份shell:
#!/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>&1&& if [ ! -x `which mysqldump` ];then echo "No found mysqldump or No permit!" exit 5 else mysqldump -uroot -p$DBPasswd $DataBase > $BackupDir$DataBase$DateNow || echo "mysqldump error!" && /usr/bin/scp $BackupDir$DataBase$DateNow $BackDir >> $BackupLog 2>&1&& rm -rf $BackupDir$DataBase$DateNow >> $BackupLog 2>&1&& /bin/echo "$DataBase's DB back end---[`date +%Y-%m-%d/%H:%M:%S`]" >> $BackupLog 2>&1 fi echo " " >> $BackupLog 2>&1 } MysqlDump
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。