- Lab
- A Cloud Guru
Performing Backups and Restores on a Linux Host
The Linux command line provides several utilities for creating and restoring backups. The `tar` command can be used to create compressed archives of files and directories. The `dd` command can be used to copy and restore drives and partitions, and to create image files of drives and partitions that can be used for backups. Both archives and image files, as well as regular files and directories, can be remotely synced using the `rsync` command. In this lab, you will be tasked with using these utilities to back up important data on a Linux host and sync it to a backup server.
Path Info
Table of Contents
-
Challenge
Use the tar Command to Create Backups of Directories on the server01 Host
- Create an archive called
full_bkp.tgz
in/home/cloud_user
usinggzip
compression on the following directories:/home
,/etc
,/opt
,/usr/local
,/root
, and/srv
. - Create an archive called
var_bkp.tbz
in/home/cloud_user
of the/var
directory usingbzip2
compression.
- Create an archive called
-
Challenge
Use the dd Command to Create and Restore Backups of Devices on the server01 Host
- Use
/home/cloud_user/xvdg.img
to restore the/dev/xvdg
device (use a byte size of 4MB). - Create an image file of
/dev/xvdf
in/home/cloud_user/
, and call itxvdf.img.bz
(it should be compressed withbzip2
). - Once the
xvdf.img.bz
file has been created, wipe the/dev/xvdf
device using the/dev/zero
device.
- Use
-
Challenge
Synchronize Backups to server02 Using the rysnc Command on the server01 Host
- Sync (with compression)
var_bkp.tbz
andfull_bkp.tgz
to/home/cloud_user/archive
on server02. Permissions and timestamps should be preserved. - Sync
xvdf.img.bz
to/home/cloud_user/archive
. Do not use archive mode or compression. - Sync (with compression) the following directories to
/home/cloud_usr/sync
on server02:/home
,/etc
,/opt
,/usr/local
,/var/lib
,/var/log
,/root
,/srv
. Permissions and timestamps should be preserved.
- Sync (with compression)
-
Challenge
Validate the Backup Files and Directories Were Successfully Copied on the server02 Host
- List the contents of the
/home/cloud_user/archive
directory. - List the contents of the
/home/cloud_user/sync
directory.
- List the contents of the
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.