>_ IzzyLab

Hands-on task

This task is step 13 of the course “Archives and backups”

tar: incremental backup

medium~10 min

Make a full backup of /root/work into /root/full.tar with a snapshot file /root/snap.snar. Then create the file /root/work/f2.txt and make an incremental backup into /root/inc.tar using the same snapshot. The incremental archive must contain only the new file, not the old one.

What you'll practise:
  • tar
  • incremental backup
  • snapshot
  • backups

Topic breakdown

Incremental backups in tar are built around a snapshot file (--listed-incremental) that stores a picture of the directory's state as of the previous run. The first run with a nonexistent snapshot grabs the entire contents and creates the picture — that's a full backup; a repeat run with the same snapshot compares the current state against the picture and puts only new and changed items into the archive. Mental model: whether a backup is full or incremental is determined not by a separate option but only by whether the snapshot file already holds accumulated state. Only the output archive name changes; the command is essentially the same.

What's checked

  1. full backup contains f1.txt
  2. incremental archive contains only f2.txt

What it looks like