Tuesday, 3 July 2018

Jenkins how to clear cache

In this article we will see how to clear cache for Jenkins

Introduction:

While deploying new installation or driver, there is a need to clear cache for Jenkins. Even though Jenkins is removed, the previous installation details (as cache) can cause issue to the new installation. The solution lies in clearing the cache.



Background & Solution:

To understand this, first find out which all paths / locations where jenkins will be installed.

[root@server1 install]# rpm -ql jenkins
/etc/init.d/jenkins
/etc/logrotate.d/jenkins
/etc/sysconfig/jenkins
/usr/lib/jenkins
/usr/lib/jenkins/jenkins.war
/usr/sbin/rcjenkins /var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins

So, as you can see these are the above paths / locations where jenkins will be installed. Any jenkins cache files, which remains in these paths might cause trouble to the new installation. So as a solution to this problem, we need to remove all files from these paths:
/var/cache/jenkins
/var/lib/jenkins
/var/log/jenkins

Here are the steps / commands to clear cache:

[root@server1 install]# rm -rf /var/cache/jenkins/*
[root@server1 install]# rm -rf  /var/lib/jenkins/*
[root@server1 install]# rm -rf /var/log/jenkins/*

After these paths / locations are cleared, we can go ahead with a new installation with no previous cache.

That's all about steps to clear cache for Jenkins. If you have queries, please write in comment section. Thanks.

1 comment:

  1. It is pretty common for certain information from numerous websites to be kept in the form of cookies and caches while using any browser. Although these cookies and cache do not often affect browsing, it is nevertheless a good idea to erase such data sometimes. It is advised to remove cookies in Google Chrome to prevent any loading or formatting issues. You may now be wondering how to delete cookies and cache on Google Chrome. Here are a few methods that can save your life if you've never cleared your cache or browsing history. Once you take these simple steps, you're done with it.
    clear cache chrome

    ReplyDelete