zoukankan      html  css  js  c++  java
  • 011. jenkins 备份

    Jenkins目录介绍

    1. 主配置文件:  /etc/sysconfig/jenkins
    2. Jenkins主目录: /var/lib/jenkins/
    [root@node1 plugins]# ll /var/lib/jenkins/
    total 227060
    -rw-------   1 jenkins jenkins       788 Dec 25 16:25 com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.xml
    -rw-------   1 jenkins jenkins       365 Dec 25 16:25 com.dabsquared.gitlabjenkins.GitLabPushTrigger.xml
    -rw-------   1 jenkins jenkins      1822 Dec 25 16:25 config.xml
    -rw-------   1 jenkins jenkins       172 Dec 25 16:25 hudson.model.UpdateCenter.xml
    -rw-------   1 jenkins jenkins       370 Dec 25 16:25 hudson.plugins.git.GitTool.xml
    -rw-------   1 jenkins jenkins      1712 Dec 25 15:07 identity.key.enc
    -rw-------   1 jenkins jenkins        94 Dec 25 15:07 jenkins.CLI.xml
    -rw-r--r--   1 jenkins jenkins         4 Dec 25 15:38 jenkins.install.InstallUtil.lastExecVersion
    -rw-r--r--   1 jenkins jenkins         4 Dec 25 15:38 jenkins.install.UpgradeWizard.state
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 15:07 jobs
    drwxr-xr-x   4 jenkins jenkins        37 Dec 25 16:25 logs
    -rw-------   1 jenkins jenkins       907 Dec 25 16:25 nodeMonitors.xml
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 15:07 nodes
    drwxr-xr-x 117 jenkins jenkins     12288 Dec 25 16:23 plugins
    -rw-r--r--   1 root    root    232436856 Oct  4  2018 plugins.tar.gz
    -rw-------   1 jenkins jenkins       129 Dec 25 16:25 queue.xml.bak
    -rw-------   1 jenkins jenkins        64 Dec 25 15:07 secret.key
    -rw-r--r--   1 jenkins jenkins         0 Dec 25 15:07 secret.key.not-so-secret
    drwx------   4 jenkins jenkins      4096 Dec 25 15:41 secrets
    -rw-r--r--   1 jenkins jenkins         0 Dec 25 16:32 ThinBackup Worker Thread.log
    drwxr-xr-x   2 jenkins jenkins       182 Dec 25 16:25 updates
    drwxr-xr-x   2 jenkins jenkins        24 Dec 25 15:07 userContent
    drwxr-xr-x   3 jenkins jenkins        19 Dec 25 15:07 users
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 16:25 workflow-libs
    
    3. Jenkins程序包: /usr/lib/jenkins/jenkins.war
    
    4. jenkins程序包: /var/cache/jenkins/
    [root@node1 plugins]# ll /var/cache/jenkins/
    total 4
    drwxr-xr-x 10 jenkins jenkins 4096 Dec 25 15:07 war
    
    5. Jenkins程序目录: /var/cache/jenkins/
    
    6. Jenkins日志目录: /var/log/jenkins/
    
    
    
    [root@node1 plugins]# rpm -ql jenkins
    /etc/init.d/jenkins          #启动文件
    /etc/logrotate.d/jenkins     #日志相关文件
    /etc/sysconfig/jenkins       #jenkins主配置文件
    /usr/lib/jenkins       #Jenkins主目录  它是由/etc/sysconfig/jenkins 配置决定的. 同时备份时也可以备份此目录
                           #包括启动端口,主目录 都是这个配置文件决定的.
    /usr/lib/jenkins/jenkins.war #Jenkins程序包 在升级的时候,将新版本的war包替换这个war包就完成了升级.
    /usr/sbin/rcjenkins          #Jenkins的二进制文件目录
    /var/cache/jenkins           #Jenkins 运行程序时解压出的文件
    /var/lib/jenkins             #Jenkins主目录
    /var/log/jenkins             #Jenkins日志目录.
    
    
    #Jenkins主目录重要配置文件和目录:
    [root@node1 jenkins]# ll /var/lib/jenkins/
    total 227060
    -rw-------   1 jenkins jenkins       788 Dec 25 16:25 com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.xml
    -rw-------   1 jenkins jenkins       365 Dec 25 16:25 com.dabsquared.gitlabjenkins.GitLabPushTrigger.xml
    -rw-------   1 jenkins jenkins      1822 Dec 25 16:25 config.xml
    -rw-------   1 jenkins jenkins       172 Dec 25 16:25 hudson.model.UpdateCenter.xml
    -rw-------   1 jenkins jenkins       370 Dec 25 16:25 hudson.plugins.git.GitTool.xml
    -rw-------   1 jenkins jenkins      1712 Dec 25 15:07 identity.key.enc
    -rw-------   1 jenkins jenkins        94 Dec 25 15:07 jenkins.CLI.xml
    -rw-r--r--   1 jenkins jenkins         4 Dec 25 15:38 jenkins.install.InstallUtil.lastExecVersion
    -rw-r--r--   1 jenkins jenkins         4 Dec 25 15:38 jenkins.install.UpgradeWizard.state
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 15:07 jobs
    drwxr-xr-x   4 jenkins jenkins        37 Dec 25 16:25 logs  #日志目录
    -rw-------   1 jenkins jenkins       907 Dec 25 16:25 nodeMonitors.xml
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 15:07 nodes
    drwxr-xr-x 117 jenkins jenkins     12288 Dec 25 16:23 plugins
    -rw-r--r--   1 root    root    232436856 Oct  4  2018 plugins.tar.gz
    -rw-------   1 jenkins jenkins       129 Dec 25 16:25 queue.xml.bak
    -rw-------   1 jenkins jenkins        64 Dec 25 15:07 secret.key
    -rw-r--r--   1 jenkins jenkins         0 Dec 25 15:07 secret.key.not-so-secret
    drwx------   4 jenkins jenkins      4096 Dec 25 15:41 secrets
    -rw-r--r--   1 jenkins jenkins         0 Dec 25 16:44 ThinBackup Worker Thread.log
    drwxr-xr-x   2 jenkins jenkins       182 Dec 25 16:25 updates
    drwxr-xr-x   2 jenkins jenkins        24 Dec 25 15:07 userContent
    drwxr-xr-x   3 jenkins jenkins        19 Dec 25 15:07 users  #Jenkins用户配置目录,用户加密的密码也在这
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 16:25 workflow-libs
    
    #用户配置文件:
    /var/lib/jenkins/users/admin/config.xml
    

    Jenkins简单粗暴备份

    [root@node1 jenkins]# ll
    total 227060
    -rw-------   1 jenkins jenkins       788 Dec 25 16:25 com.dabsquared.gitlabjenkins.connection.GitLabConnectionConfig.xml
    -rw-------   1 jenkins jenkins       365 Dec 25 16:25 com.dabsquared.gitlabjenkins.GitLabPushTrigger.xml
    -rw-------   1 jenkins jenkins      1822 Dec 25 16:25 config.xml
    -rw-------   1 jenkins jenkins       172 Dec 25 16:25 hudson.model.UpdateCenter.xml
    -rw-------   1 jenkins jenkins       370 Dec 25 16:25 hudson.plugins.git.GitTool.xml
    -rw-------   1 jenkins jenkins      1712 Dec 25 15:07 identity.key.enc
    -rw-------   1 jenkins jenkins        94 Dec 25 15:07 jenkins.CLI.xml
    -rw-r--r--   1 jenkins jenkins         4 Dec 25 15:38 jenkins.install.InstallUtil.lastExecVersion
    -rw-r--r--   1 jenkins jenkins         4 Dec 25 15:38 jenkins.install.UpgradeWizard.state
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 15:07 jobs
    drwxr-xr-x   4 jenkins jenkins        37 Dec 25 16:25 logs
    -rw-------   1 jenkins jenkins       907 Dec 25 16:25 nodeMonitors.xml
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 15:07 nodes
    drwxr-xr-x 117 jenkins jenkins     12288 Dec 25 16:23 plugins
    -rw-r--r--   1 root    root    232436856 Oct  4  2018 plugins.tar.gz
    -rw-------   1 jenkins jenkins       129 Dec 25 16:25 queue.xml.bak
    -rw-------   1 jenkins jenkins        64 Dec 25 15:07 secret.key
    -rw-r--r--   1 jenkins jenkins         0 Dec 25 15:07 secret.key.not-so-secret
    drwx------   4 jenkins jenkins      4096 Dec 25 15:41 secrets
    -rw-r--r--   1 jenkins jenkins         0 Dec 25 16:49 ThinBackup Worker Thread.log
    drwxr-xr-x   2 jenkins jenkins       182 Dec 25 16:25 updates
    drwxr-xr-x   2 jenkins jenkins        24 Dec 25 15:07 userContent
    drwxr-xr-x   3 jenkins jenkins        19 Dec 25 15:07 users
    drwxr-xr-x   2 jenkins jenkins         6 Dec 25 16:25 workflow-libs
    
    
    直接打包 /var/lib/jenkins 就可以了:
    tar zcf jenkins_$(date +%F).tar.gz /var/lib/jenkins
    

    微信赞赏

    支付宝赞赏

  • 相关阅读:
    Linux 安装 jdk 后 jps 出现问题/usr/jdk1.8.0_151/bin/jps: /lib/ld-linux.so.2: bad ELF interpreter: No such
    Jackson 注解
    Git 右键添加Git Bash
    No validator could be found for constraint
    rror querying database. Cause: java.sql.SQLException: null, message from server: "Host '192.168.30.1' is not allowed to connect to this MySQL server"
    Linux 安装 Mysql-5.7.23-linux-glibc2
    Promise
    PAT(B) 1094 谷歌的招聘(Java)
    PAT(B) 1074 宇宙无敌加法器(Java)
    PAT(B) 1078 字符串压缩与解压(Java)
  • 原文地址:https://www.cnblogs.com/superlinux/p/15385194.html
Copyright © 2011-2022 走看看