GithubHelp home page GithubHelp logo

byteinternet / jenkins-backup-script Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sue445/jenkins-backup-script

0.0 11.0 0.0 28 KB

archive jenkins setting and plugins

Home Page: http://sue445.hatenablog.com/entry/2013/12/08/005317

Ruby 72.74% Shell 27.26%

jenkins-backup-script's Introduction

Jenkins backup script

Build Status

Archive Jenkins settings and plugins

  • $JENKINS_HOME/*.xml
  • $JENKINS_HOME/plugins/*.jpi
  • $JENKINS_HOME/jobs//.xml
  • $JENKINS_HOME/users/*

Usage

./jenkins-backup.sh /path/to/jenkins_home archive.tar.gz

# add timestamp suffix
./jenkins-backup.sh /path/to/jenkins_home backup_`date +"%Y%m%d%H%M%S"`.tar.gz

run with Jenkins Job

1. install Exclusive Execution Plugin

https://wiki.jenkins-ci.org/display/JENKINS/Exclusive+Execution+Plugin

2. New Job

img

3. Configure

Source Code Management > Repository URL

https://github.com/sue445/jenkins-backup-script.git
  • Recommended : specify Branch Specifier with latest release tag
  • latest tag is 0.0.8

0.0.3

Build Triggers > Build periodically

img

Build Environment > Set exclusive Execution

img

Build > Execute shell

img

ex.

./jenkins-backup.sh $JENKINS_HOME /path/to/backup_`date +"%Y%m%d%H%M%S"`.tar.gz

Operability confirmed

  • Debian lenny
  • CentOS 6

UnitTest

install ruby 2.1+

bundle install
bundle exec rake test

Tips

rotate backup files

# keep backup with latest 30 days
find /path/to/backup_* -mtime +30 | xargs rm -f

Changelog

CHANGELOG.md

jenkins-backup-script's People

Contributors

sue445 avatar maafy6 avatar ynott avatar jackleo avatar sejeff avatar jgeiger avatar banyan avatar rubenjgarcia avatar

Watchers

James Cloos avatar Maarten van Schaik avatar Allard Hoeve avatar Jeroen van Heugten avatar Cipriano Groenendal avatar Daniel avatar Sophia Davis avatar Alexander Grooff avatar  avatar Sven avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.