Skip to content

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
  • Labs icon Lab
  • A Cloud Guru
Google Cloud Platform icon
Labs

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.

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Intermediate
Duration
Clock icon 30m
Published
Clock icon Jul 16, 2021

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.

Table of Contents

  1. 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 using gzip 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 using bzip2 compression.
  2. 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 it xvdf.img.bz (it should be compressed with bzip2).
    • Once the xvdf.img.bz file has been created, wipe the /dev/xvdf device using the /dev/zero device.
  3. Challenge

    Synchronize Backups to server02 Using the rysnc Command on the server01 Host

    • Sync (with compression) var_bkp.tbz and full_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.
  4. 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.

The Cloud Content team comprises subject matter experts hyper focused on services offered by the leading cloud vendors (AWS, GCP, and Azure), as well as cloud-related technologies such as Linux and DevOps. The team is thrilled to share their knowledge to help you build modern tech solutions from the ground up, secure and optimize your environments, and so much more!

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.

Start learning by doing today

View Plans