0
0
Jenkinsdevops~10 mins

Backup and restore strategies in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Jenkins home directory for backup.

Jenkins
JENKINS_HOME=[1]
Drag options to blanks, or click blank then click option'
A/var/lib/jenkins
B/etc/jenkins
C/usr/local/jenkins
D/opt/jenkins
Attempts:
3 left
💡 Hint
Common Mistakes
Using system config directories like /etc/jenkins instead of the home directory.
2fill in blank
medium

Complete the command to create a compressed backup archive of the Jenkins home directory.

Jenkins
tar -czf jenkins_backup.tar.gz [1]
Drag options to blanks, or click blank then click option'
A/etc/jenkins
B/opt/jenkins
C/var/lib/jenkins
D/usr/share/jenkins
Attempts:
3 left
💡 Hint
Common Mistakes
Backing up system directories instead of Jenkins data directory.
3fill in blank
hard

Fix the error in the restore command to extract the backup archive to the Jenkins home directory.

Jenkins
tar -xzf jenkins_backup.tar.gz -C [1]
Drag options to blanks, or click blank then click option'
A/etc/jenkins
B/opt/jenkins
C/usr/local/jenkins
D/var/lib/jenkins
Attempts:
3 left
💡 Hint
Common Mistakes
Extracting to wrong directories causing Jenkins to not find its data.
4fill in blank
hard

Fill both blanks to create a backup script that stops Jenkins, backs up data, and restarts Jenkins.

Jenkins
sudo systemctl [1] jenkins
sudo tar -czf jenkins_backup.tar.gz [2]
sudo systemctl start jenkins
Drag options to blanks, or click blank then click option'
Astop
Brestart
C/var/lib/jenkins
D/etc/jenkins
Attempts:
3 left
💡 Hint
Common Mistakes
Restarting Jenkins before backup or backing up wrong directories.
5fill in blank
hard

Fill all three blanks to create a restore script that stops Jenkins, restores backup, and restarts Jenkins.

Jenkins
sudo systemctl [1] jenkins
sudo tar -xzf jenkins_backup.tar.gz -C [2]
sudo systemctl [3] jenkins
Drag options to blanks, or click blank then click option'
Astop
Bstart
C/var/lib/jenkins
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Starting Jenkins before restore or extracting to wrong directory.