Lesson 15 — Basic Backup, Archives & File Transfer

CompTIA Cyber Path • Linux / Admin Basics • Lesson 15

Lesson 15 — Basic Backup, Archives & File Transfer

cp + rsync + tar + gzip + scp

Linux administrators move and protect data all the time. This lesson teaches a clean workflow using cp for simple copies, rsync for smarter synchronized backups, tar for archiving files into one bundle, gzip for compression, and scp for secure file transfer between systems.

Core idea:

Good data handling follows a simple pattern: decide whether you need a copy, a sync, an archive, or a transferrun the correct commandverify the result.

What you’ll be able to do:

Copy files safely, back up folders with rsync, create archives with tar, compress files with gzip, and securely transfer files with scp.

Linux basics cp + rsync tar + gzip scp + local progress
Progress: 0%
Copy or Sync?cp vs rsync
Archive Datatar
Compress If Neededgzip
Transfer Securelyscp
Good workflow: Do I need a copy, sync, archive, or transfer?Use the correct toolVerify the result before assuming success

Lesson Objectives

By the end of this lesson

  • Copy files and directories with cp
  • Use rsync for efficient backup-style syncing
  • Create archives with tar
  • Compress files with gzip
  • Transfer files between systems with scp

Why this matters

  • Admins need safe ways to protect important data
  • Copying and syncing are not the same thing
  • Archives make many files easier to move and store
  • Secure file transfer is part of real support work

1) Copy Files with cp

Copy one file

Use cp when you want a straightforward copy of a file.

cp report.txt report-backup.txt

Copy a directory

Use the recursive option to copy a whole directory and its contents.

cp -r project/ project-backup/

What cp is good for

  • Quick one-time copies
  • Simple local backups
  • Duplicating a file before editing it
Important habit:

cp is simple, but simple is not always enough. For repeated backups or folder sync jobs, rsync is often the stronger tool.

2) Sync Smarter with rsync

rsync is commonly used for backup-style file synchronization because it is efficient and flexible.

Basic sync example

rsync -av project/ backup-project/

This copies files while preserving useful metadata and showing what is being transferred.

Why rsync is stronger

  • Good for repeated backups
  • Efficient for syncing folders
  • Often avoids copying everything again unnecessarily

Common beginner mistake

Pay attention to trailing slashes. In many cases, project/ and project do not mean exactly the same thing in rsync.

3) Create Archives with tar

tar bundles many files into one archive, which makes backup and transfer easier.

Create an archive

tar -cvf project.tar project/

This creates an archive file named project.tar.

Extract an archive

tar -xvf project.tar

This extracts the contents of the archive.

Why tar matters

  • Many files become one manageable archive
  • Archives are easier to move or store
  • Common in Linux backups and deployments

4) Compress Files with gzip

gzip is used to compress files and reduce storage or transfer size.

Compress a file

gzip project.tar

This usually turns project.tar into project.tar.gz.

Decompress a file

gunzip project.tar.gz

This restores the compressed file back to its uncompressed form.

Common workflow

tar -cvf project.tar project/ gzip project.tar

This is a common beginner-friendly way to archive first and compress second.

5) Transfer Files Securely with scp

scp securely copies files between systems over SSH.

Copy local file to remote host

scp backup.tar.gz user@server:/home/user/

This sends the file to a remote system.

Copy remote file to local system

scp user@server:/home/user/backup.tar.gz .

This pulls the remote file into your current local directory.

Why scp matters

  • Uses secure SSH transport
  • Good for moving backups or logs
  • Common in admin support tasks
Real-world habit:

After any copy, backup, archive, or transfer, verify the result. A “successful command” is not enough unless the data is actually where it should be.

6) Fast Troubleshooting Pattern

  1. Decide whether you need a simple copy, a sync, an archive, or a transfer
  2. Use the correct command for that goal
  3. Verify the copied, archived, or transferred data exists
  4. Do not assume success without checking
cp report.txt report-backup.txt rsync -av project/ backup-project/ tar -cvf backup.tar project/ gzip backup.tar scp backup.tar.gz user@server:/home/user/

Practical — Back Up and Transfer a Project Folder

This practical teaches a real support workflow instead of random command memorization.

Practical Task

  • Make a simple copy of a file with cp
  • Sync a folder with rsync
  • Create an archive with tar
  • Compress the archive with gzip
  • Write how you would securely send it using scp

Walkthrough

cp notes.txt notes-backup.txt rsync -av project/ backup-project/ tar -cvf project.tar project/ gzip project.tar scp project.tar.gz user@server:/home/user/

The point is not to memorize a giant list. The point is to know which tool fits which job and verify the result each time.

Example Ticket Note

Created local backup copy of user file, synchronized project directory with rsync, archived data with tar, compressed archive with gzip, and prepared secure transfer command using scp.

Write Your Observation

Use a simple note like a junior admin would write.

Mini Knowledge Check

Score 75% or higher to unlock the next lesson link. Your score is saved on this browser.

1) Which command is best for a simple one-time file copy?

2) What is a strong reason to use rsync?

3) Which command creates an archive file?

4) What is the strongest lesson habit here?

Next Lesson

🔒 Locked until quiz ≥ 75% and you mark complete
Lesson 16 — Scheduling & Automation Basics

Tip: update the next lesson link when your page exists.

Leave a Comment