Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lacoski/159d01b08125fcc43b2f1c1e889bd42a to your computer and use it in GitHub Desktop.
Save lacoski/159d01b08125fcc43b2f1c1e889bd42a to your computer and use it in GitHub Desktop.

Revisions

  1. @darinpope darinpope revised this gist Feb 16, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion How-to-Backup-Jenkins-Using-Kopia.md
    Original file line number Diff line number Diff line change
    @@ -42,7 +42,7 @@ Gist for https://www.youtube.com/watch?v=38di3_iVDIA

    ```
    #!/bin/bash
    /bin/kopia repository connect s3 --bucket=jenkins-backup-832291
    /bin/kopia repository connect s3 --bucket=<<bucketId>>
    /bin/kopia snapshot create --all
    ```

  2. @darinpope darinpope revised this gist Feb 16, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion How-to-Backup-Jenkins-Using-Kopia.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Gist for
    Gist for https://www.youtube.com/watch?v=38di3_iVDIA

    # Commands

  3. @darinpope darinpope revised this gist Feb 16, 2022. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions How-to-Backup-Jenkins-Using-Kopia.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,17 @@
    Gist for

    # Commands

    * `kopia repository create s3 --bucket=<<bucketId>>`
    * `kopia repository validate-provider`
    * `kopia repository status`
    * `kopia snapshot create /var/lib/jenkins`
    * `kopia snapshot list`
    * `kopia diff <a> <b>`
    * `kopia policy show /var/lib/jenkins`
    * `kopia policy set --add-ignore .cache/ --add-ignore .groovy/ --add-ignore .java/ /var/lib/jenkins`
    * `kopia policy list`

    # AWS Policy

    ```
  4. @darinpope darinpope revised this gist Feb 16, 2022. 1 changed file with 46 additions and 1 deletion.
    47 changes: 46 additions & 1 deletion How-to-Backup-Jenkins-Using-Kopia.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,46 @@
    Documentation
    Gist for

    # AWS Policy

    ```
    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Effect": "Allow",
    "Action": [
    "s3:ListBucket"
    ],
    "Resource": "arn:aws:s3:::<<bucketId>>"
    },
    {
    "Effect": "Allow",
    "Action": [
    "s3:PutObject",
    "s3:GetObject",
    "s3:DeleteObject"
    ],
    "Resource": "arn:aws:s3:::<<bucketId>>/*"
    }
    ]
    }
    ```

    # jenkins-kopia.sh

    ```
    #!/bin/bash
    /bin/kopia repository connect s3 --bucket=jenkins-backup-832291
    /bin/kopia snapshot create --all
    ```

    # crontab

    ```
    AWS_ACCESS_KEY_ID=<<access key>>
    AWS_SECRET_ACCESS_KEY=<<secret>>
    KOPIA_PASSWORD=<<repository password>>
    KOPIA_CHECK_FOR_UPDATES=false
    */15 * * * * /root/jenkins-kopia.sh 2>&1
    ```
  5. @darinpope darinpope created this gist Feb 16, 2022.
    1 change: 1 addition & 0 deletions How-to-Backup-Jenkins-Using-Kopia.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Documentation