Jenkins: Is there any way to cleanup Jenkins workspace?

后端 未结 11 1852
既然无缘
既然无缘 2020-11-29 03:18

How can I cleanup the workspace in Jenkins? I am using AccuRev as version control tool.

I created freestyle projects in Jenkins.

11条回答
  •  旧巷少年郎
    2020-11-29 03:48

    Beside above solutions, there is a more "COMMON" way - directly delete the largest space consumer from Linux machine. You can follow the below steps:

    1. Login to Jenkins machine (Putty)
    2. cd to the Jenkins installation path

    Using ls -lart to list out hidden folder also, normally jenkin installation is placed in .jenkins/ folder

    [xxxxx ~]$ ls -lart
    
    drwxrwxr-x 12 xxxx  4096 Feb  8 02:08 .jenkins/
    
    1. list out the folders spaces

    Use df -h to show Disk space in high level

    du -sh ./*/ to list out total memory for each subfolder in current path.

    du -a /etc/ | sort -n -r | head -n 10 will list top 10 directories eating disk space in /etc/

    1. Delete old build or other large size folder

    Normally ./job/ folder or ./workspace/ folder can be the largest folder. Please go inside and delete base on you need (DO NOT delete entire folder).

    rm -rf theFolderToDelete

提交回复
热议问题