0
0
Jenkinsdevops~20 mins

Disk space management in Jenkins - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Disk Space Mastery in Jenkins
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Jenkins Disk Usage Plugin: Output Interpretation
You run the Jenkins Disk Usage plugin report on a Jenkins master node. The output shows:

Workspace: 5 GB
Builds: 10 GB
Artifacts: 3 GB
Other: 2 GB


What is the total disk space used by this Jenkins job?
A20 GB
B15 GB
C10 GB
D5 GB
Attempts:
2 left
💡 Hint
Add all the categories shown in the report to find total usage.
🔀 Workflow
intermediate
1:30remaining
Jenkins Pipeline: Clean Workspace Step Placement
In a Jenkins pipeline, you want to clean the workspace to free disk space before starting a new build. Where should you place the cleanWs() step to ensure the workspace is cleaned at the right time?
AIn the middle of the pipeline after compiling but before testing
BAt the end of the pipeline after all build steps
CAt the very start of the pipeline before any build steps
DOnly inside the post section on build failure
Attempts:
2 left
💡 Hint
Think about when you want to remove old files to avoid interference.
Troubleshoot
advanced
2:00remaining
Jenkins Disk Space Warning: Cause Identification
A Jenkins master node shows a disk space warning despite regular workspace cleaning. Which of the following is the most likely cause?
ABuild artifacts are not being deleted after retention period
BThe cleanWs() step is running too early in the pipeline
CThe Jenkins master has too many executors configured
DThe Jenkins user does not have permission to run builds
Attempts:
2 left
💡 Hint
Think about what files remain even after workspace cleaning.
Configuration
advanced
2:00remaining
Configuring Jenkins to Automatically Clean Old Builds
Which configuration snippet in a Jenkins pipeline script will automatically discard builds older than 10 days and keep only the last 5 builds to save disk space?
Aproperties([buildDiscarder(logRotator(daysToKeep: '10', numToKeep: '5'))])
Bproperties([buildDiscarder(logRotator(daysToKeepStr: 10, numToKeepStr: 5))])
Cproperties([buildDiscarder(logRotator(daysToKeepStr: '10', numToKeepStr: '5'))])
Dproperties([buildDiscarder(logRotator(daysToKeep: 10, numToKeep: 5))])
Attempts:
2 left
💡 Hint
Check the parameter types and whether they expect strings or integers.
Best Practice
expert
2:30remaining
Best Practice for Managing Disk Space on Jenkins Agents
Which of the following is the best practice to manage disk space on Jenkins agents to avoid build failures due to full disks?
AIncrease the disk size of agents without cleaning old files
BSchedule regular cleanup jobs that delete old workspaces and unused files on agents
CDisable workspace cleanup to keep all build data for debugging
DRun all builds on the Jenkins master node instead of agents
Attempts:
2 left
💡 Hint
Think about sustainable ways to keep disk space free over time.