Featured resource
Tech Upskilling Playbook 2025
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Learn more
  • Labs icon Lab
  • Cloud
  • Security
Google Cloud Platform icon
Labs

Backup and Recovery Using Rsync

This hands-on lab is designed specifically to show how a free tool, `rsync`, can be used to perform backup and recovery operations from a local system to a remote one. Rsync derives its name from its main task: remote synchronization. It is commonly used as a backup or mirroring tool, but can also be used to sync files either remotely or locally. To view the man page for rsync, click [here](https://linux.die.net/man/1/rsync).

Google Cloud Platform icon
Labs

Path Info

Level
Clock icon Beginner
Duration
Clock icon 45m
Last updated
Clock icon Aug 26, 2025

Contact sales

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

Table of Contents

  1. Challenge

    Install Rsync

    Install Rsync on both Server1 and Client1:

    yum install rsync
    

    Note: To use the above command without adding sudo, you will need to be the root user. If you do not elevate privileges to root, you will need to add sudo to the beginning of the command. Either way is fine.

  2. Challenge

    Create a Directory for Backup on Client1

    Create a new directory called files4backup:

    mkdir /home/cloud_user/files4backup
    
  3. Challenge

    Create Two Files in files4backup, tps_report1.txt and tps_report2.txt, Which Will Be Used to Verify That the Backup Was Successful Later On

    Create two new text files, tps_report1.txt and tps_report2.txt:

    touch /home/cloud_user/files4backup/tps_report1.txt
    touch /home/cloud_user/files4backup/tps_report2.txt
    
  4. Challenge

    Using rsync, Copy the Files from Client1 to Server1

    Run the following command:

    rsync -avz /home/cloud_user/files4backup/ [email protected]:/home/cloud_user/files4backup/
    

    You may be prompted for a password. If so, use the one provided on the lab page for cloud_user

    Verify that the contents of the files4backup directory were copied from Client1 to Server1. This can be accomplished by logging into Server1 and running the following commands:

    cd /home/cloud_user/files4backup
    ls
    

    The two files that we created in in the last step should be present.

  5. Challenge

    OPTIONAL - Modify tps_report1.txt and Verify That the Changes Are Carried over after Performing Another Copy to Server1

    On Client1:

    Open the tps_report1.txt file:

    vim /home/cloud_user/files4backup/tps_report1.txt
    

    Add some text to the file and save it, then perform another remote copy:

    rsync -avz /home/cloud_user/files4backup/ [email protected]:/home/cloud_user/files4backup/
    

    Back on Server1:

    Open the tps_report1.txt file to verify that the changes were carried over:

    vim tps_report1.txt
    
  6. Challenge

    Delete a File in the files4backup Directory on Client1 and Restore It from Server1

    On Client1, remove tps_report2.txt:

    rm /home/cloud_user/files4backup/tps_report2.txt
    

    Verify that it's gone:

    cd /home/cloud_user/files4backup/
    ls
    

    We should only see tps_report1.txt in there.

    From Server1, run a remote copy of our files4backup directory back to Client1:

    rsync -avz /home/cloud_user/files4backup/ [email protected]:/home/cloud_user/files4backup/
    

    Back on Client1, verify that tps_report2.txt exists:

    cd /home/cloud_user/files4backup
    ls
    

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

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.