A Jenkins backup and restore python cli tool with arguments.
Project description
Python Jenkins Backup Restore Module
Jenkins-backup-restore module takes a backup of the jenkins home directory and restores it.
####Backup
Following are the list of items that the backup module can do,
- Look for the JENKINS_HOME env values (or use the default /var/jenkins_home). Export JENKINS_HOME, if does not exists.
- Take a backup of the jenkins_home with tar and stores it in current directory (default: /var/jenkins_home)
- Move the backup tar to a specific folder locally (optional with flags).
- Push the backup tar to a specific bucket in S3 (optional with flags).
####Restore Following are the list of items that the restore module can do,
- Look for the binary in the local file system in the specific destination path.
- Extract the tar file to JENKINS_HOME path (default: /var/jenkins_home)
- Look for the a artifact binary in the s3 given a specific bucket name and download it in the current directory unless a specific artifact destination path is given. (optional with flags)
- Extract the tar file to JENKINS_HOME path (default: /var/jenkins_home)
####Installation Run the following command to install the jenkins-backup-restore tool,
pip3 install jenkins-backup-restore
####Backup and Restore Arguments: Once the binary is installed with pip3, use the following command line argument to either take a backup or restore the existing backup.
--v, --version Show program's version number
--cn, --custom-archive-name Give the backup a custom name
# backup to a local dir command and argument
backup-local Save the archive to a local directory
-bd, --backup-destination-path, Local path to store the backup
# backup to s3 command and argument
backup-s3 Push the archive to an s3 bucket
-bb, --backup-bucket-name, Bucket name to push an archive to s3
# restore archive from a local directory
restore-local Restore archive from a local directory
-rs, --restore-source-path Path to the archive in local directory
-rd, --restore-destination-path If destination path is other than the default path (/var/jenkins_home)
# restore archive from an s3 bucket
restore-s3 Pull an archive from an s3 bucket to a specific location and restore it
-rb, --restore-bucket-name Bucket name to download the archive from
-adp, --artifact-destination-path Path to save the downloaded archive from an s3 bucket
{backup,restore} use either backup to backup or use restore to restore
####Examples
To give a custom name to the backup
jenkins-backup-restore backup-local --cn <custom-name.tar.gz> backup
If
--backup-destination-path
not specified, stores in the current directory.
To backup jenkins to local directory,
jenkins-backup-restore backup-local --backup-destination-path <custom-dir> backup
To backup jenkins to an s3 bucket,
jenkins-backup-restore backup-local --backup-bucket-name <bucket-name> backup
To restore an archive from local path,
jenkins-backup-restore restore-local --restore-source-path <archive-path> restore
To restore an archive from an s3 bucket,
jenkins-backup-restore restore-s3 --restore-bucket-name <bucket-name> --artifact-destination-path <path-to-download-in-local> restore
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for jenkins-backup-restore-cli-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 553267559df91e72d440f67823b4e63f0c89518c49a494e351793f5ad59da475 |
|
MD5 | 6ba29b7d5ace87382ece3f8ed2a31fcf |
|
BLAKE2b-256 | d0c4d212fb08b2068f8a9487649336fda90337368aed973a3e1af0ef2dfa54b4 |
Hashes for jenkins_backup_restore_cli-1.0.0-py3.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ee28732c764aba5352cf2f69c56b9e8aea31f886ab66455d1a2895a0a3942fe |
|
MD5 | d800b006c811013eccf1e7854ea3adf8 |
|
BLAKE2b-256 | 8e947147e4f4da1a59ac0cb50540b2901cc4b3452bd5730b3e2ce1bc183e41c4 |
Hashes for jenkins_backup_restore_cli-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a749fd2094268797c35ec3ae893fdb333abe2e785934f42369e47da76c0bc5c |
|
MD5 | 0e043f1c444fccf32168de8ce0186bce |
|
BLAKE2b-256 | 9da3982d300b30f10b7eb3acd8fd29a1b2d0b5fcd774df9bee3d4d77bd44f649 |