只需要6步,即可搞定自动备份及清理confluence数据库及应用配置文件
1、准备清理脚本clean_confluence.sh
#!/bin/bash
/bin/rm -rf /usr/local/confluence/home/backups/*`date -d '-7 days' +%Y_%m_%d`*
2、准备备份confluence-home及mysql文件backup.sh
#!/bin/bash
today=`date +'%Y-%m-%d'`
workpath=/app/confluence
echo "`date`">${workpath}/backups/lunchttime -zcf ${workpath}/backups/atlassian-confluence-5.10.8_.${today}.tgz ${workpath}/confluence
tar -zcf ${workpath}/backups/confluence-home_.${today}.tar.gz ${workpath}/confluence/home
mysqldump -u root -p123456 confluence > ${workpath}/backups/mysql_confluence.backup.${today}.sql
echo "`date`">>${workpath}/backups/lunchttime.${today}.txt