{"id":14235548,"url":"https://github.com/sue445/jenkins-backup-script","last_synced_at":"2025-05-15T00:13:59.206Z","repository":{"id":1589015,"uuid":"15007554","full_name":"sue445/jenkins-backup-script","owner":"sue445","description":"archive jenkins setting and plugins","archived":false,"fork":false,"pushed_at":"2025-04-27T20:45:40.000Z","size":373,"stargazers_count":486,"open_issues_count":3,"forks_count":433,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-27T21:30:44.776Z","etag":null,"topics":["jenkins","shell"],"latest_commit_sha":null,"homepage":"http://sue445.hatenablog.com/entry/2013/12/08/005317","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sue445.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-07T15:10:25.000Z","updated_at":"2025-04-27T20:45:43.000Z","dependencies_parsed_at":"2023-07-05T15:45:45.311Z","dependency_job_id":"6061141d-aa88-4a6d-989b-c1505b607134","html_url":"https://github.com/sue445/jenkins-backup-script","commit_stats":{"total_commits":338,"total_committers":30,"mean_commits":"11.266666666666667","dds":0.6301775147928994,"last_synced_commit":"0ae30d8f24556d85f15b4bee73624c9c25028847"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fjenkins-backup-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fjenkins-backup-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fjenkins-backup-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sue445%2Fjenkins-backup-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sue445","download_url":"https://codeload.github.com/sue445/jenkins-backup-script/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254249206,"owners_count":22039029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jenkins","shell"],"created_at":"2024-08-20T21:02:04.076Z","updated_at":"2025-05-15T00:13:54.196Z","avatar_url":"https://github.com/sue445.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# Jenkins backup script\n[![test](https://github.com/sue445/jenkins-backup-script/actions/workflows/test.yml/badge.svg)](https://github.com/sue445/jenkins-backup-script/actions/workflows/test.yml)\n\nArchive Jenkins settings and plugins\n\n* `$JENKINS_HOME/*.xml`\n* `$JENKINS_HOME/*.jks`\n* `$JENKINS_HOME/jobs/*/*.xml`\n* `$JENKINS_HOME/nodes/*`\n* `$JENKINS_HOME/plugins/*.jpi`\n* `$JENKINS_HOME/secrets/*`\n* `$JENKINS_HOME/users/*`\n\n# Usage\n```sh\n./jenkins-backup.sh /path/to/jenkins_home archive.tar.gz\n\n# add timestamp suffix\n./jenkins-backup.sh /path/to/jenkins_home backup_`date +\"%Y%m%d%H%M%S\"`.tar.gz\n```\n\n# run with Jenkins Job\n## 1. install Exclusive Execution Plugin\nhttps://wiki.jenkins-ci.org/display/JENKINS/Exclusive+Execution+Plugin\n\n## 2. New Job\n![img](http://cdn-ak.f.st-hatena.com/images/fotolife/s/sue445/20131208/20131208001948.png)\n\n## 3. Configure\n### Source Code Management \u003e Repository URL\n```\nhttps://github.com/sue445/jenkins-backup-script.git\n```\n\n* **Recommended** : specify Branch Specifier with latest release tag\n* Check https://github.com/sue445/jenkins-backup-script/releases\n\n![0.0.3](http://f.st-hatena.com/images/fotolife/s/sue445/20140331/20140331010645.png)\n\n### Build Triggers \u003e Build periodically\n![img](http://cdn-ak.f.st-hatena.com/images/fotolife/s/sue445/20131110/20131110180825.png)\n\n### Build Environment \u003e Set exclusive Execution\n![img](http://cdn-ak.f.st-hatena.com/images/fotolife/s/sue445/20131110/20131110194540.png)\n\n### Build \u003e Execute shell\n![img](http://cdn-ak.f.st-hatena.com/images/fotolife/s/sue445/20131110/20131110193935.png)\n\nex.\n\n```bash\n./jenkins-backup.sh $JENKINS_HOME /path/to/backup_`date +\"%Y%m%d%H%M%S\"`.tar.gz\n```\n\n# Operability confirmed\n* Debian wheezy\n* Debian jessie\n* Debian stretch\n* Debian buster\n* CentOS 6\n* CentOS 7\n\n## Testing\nrequirements [Docker](https://www.docker.com/)\n\n```sh\nbundle install\n\nbundle exec itamae docker --node-yaml=spec/node.yml spec/recipes/bootstrap.rb --image=centos:7 --tag local:latest\nDOCKER_IMAGE=local:latest bundle exec rspec\n```\n\n# Tips\n## rotate backup files\n```bash\n# keep backup with latest 30 days\nfind /path/to/backup_* -mtime +30 -delete\n```\n\n## Restore commands\nexample\n\n```bash\nsudo /etc/init.d/jenkins stop\ncd /path/to/backup_dir\ntar xzvf backup.tar.gz\nsudo cp -R jenkins-backup/* /path/to/jenkins/\nsudo chown jenkins:jenkins -R /path/to/jenkins/\nsudo /etc/init.d/jenkins start\n```\n\n# Changelog\n[CHANGELOG.md](CHANGELOG.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsue445%2Fjenkins-backup-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsue445%2Fjenkins-backup-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsue445%2Fjenkins-backup-script/lists"}