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