Automating Bamboo backup operations

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

Bamboo supports 2 methods of taking a backup of the instance which can be either manual or scheduled backup as explained in Exporting data for backup. The following script provides an alternative method via a script that takes a dump of the native database. This is particularly useful at times when the backup is corrupted or the xml file are malformed.

Backup Script
#!/bin/sh
rsync="/usr/bin/rsync -a --numeric-ids --sparse --delete"
bakd=/path_to_new_backup
bakf=$bakd/bamb_database.sql
url="http://localhost:10572/bamboo572/rest/api/latest/server"
# pause Bamboo
#We are using user admin with password admin. Replace as appropriate
/usr/bin/curl -X POST --user admin:admin $url/pause?os_authType=basic
# Check if the server is paused before proceeding
curl -H "Content-Type:application/json" -H "Accept:application/json" -u admin:admin -X GET $url
#This is an expected result
#{"state":"PAUSED","reindexInProgress":false}

# Bamboo home
$rsync --exclude=build-dir --exclude=build_logs --exclude=artifacts /path_to_bamboo_home $bakd
# Database
# Replace root with the database user
 mysqldump -uroot -proot bamboo > $bakf
# resume Bamboo
/usr/bin/curl -X POST --user admin:admin $url/resume?os_authType=basic

The above script can be adapted based on the native database backup tool. In this case we were using the mysql.

 

最終更新日 2015 年 6 月 9 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.