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.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- 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
- 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
- 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)
- 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