Sangharsh OS

Documentation/System

Backups & snapshots

Every one of these guides involves changing system files. This one is about being able to undo that. Timeshift for the system, rsync for your files, and a verification step so you know the backup is real.

A snapshot and a backup are not the same thing. A snapshot lives on the same disk and gets you out of a bad update in ninety seconds. A backup lives somewhere else and survives the disk dying. You want both, and neither one is much work once it is scheduled.

Timeshift: system snapshots

Timeshift records the system files and leaves your personal files alone, which is exactly the right scope for undoing a driver install or a botched upgrade.

sudo apt install timeshift
  1. Choose RSYNC unless your root filesystem is Btrfs, in which case choose BTRFS — it is instant and costs almost no space.
  2. Pick a snapshot location. An external drive is better than the internal disk; a snapshot on the same disk does not help if the disk fails.
  3. Set a schedule: daily, keeping five. Weekly with three is fine for a desktop.
  4. Under Users, exclude your home directory — Timeshift is not a file backup, and including home fills the drive.
  5. Press Create for the first snapshot immediately.

Restoring

  • From a working desktop: open Timeshift, pick a snapshot, press Restore. It reboots when finished.
  • When the desktop will not start: boot the Sangharsh OS live USB, install Timeshift there if needed, point it at the snapshot drive, and restore onto the internal disk. This is the scenario snapshots exist for — try it once before you need it.

Snapshot before, not after. Take one before installing a driver, changing your desktop environment or editing /etc. Rolling back a broken NVIDIA install is a two-minute job with a snapshot and an evening without one.

rsync: your actual files

rsync copies only what changed, which makes repeated backups cheap. Always do a dry run first — the --delete flag removes files at the destination that no longer exist at the source, which is what you want for a mirror and a disaster if you have the paths backwards.

# dry run: shows what would happen, changes nothing
rsync -avhn --delete ~/Documents/ /media/you/Backup/Documents/

# the real thing, once the dry run looks right
rsync -avh --delete ~/Documents/ /media/you/Backup/Documents/

# whole home, excluding caches and the Steam library
rsync -avh --delete \
  --exclude='.cache/' --exclude='.local/share/Trash/' \
  --exclude='.steam/steam/steamapps/' \
  ~/ /media/you/Backup/home/

Note the trailing slashes on the source: ~/Documents/ copies the contents, ~/Documents copies the folder itself.

Dotfiles: the small backup that saves the most time

tar -czf ~/dotfiles-$(date +%F).tar.gz \
  ~/.config ~/.local/share/plasma ~/.ssh ~/.bashrc ~/.profile

Restoring this after a reinstall brings back your Plasma layout, application settings, SSH keys and shell aliases — most of what makes a machine feel like yours. Keep it out of public repositories: ~/.ssh contains private keys.

What is worth backing up

PathWorth it?Why
~/Documents, ~/Pictures, ~/VideosYes, alwaysIrreplaceable.
~/.configYesEvery application setting you have ever changed.
~/.ssh, ~/.gnupgYes, encryptedKeys cannot be regenerated identically.
~/.local/share/plasmaYesDownloaded themes and layouts.
~/.cacheNoRebuilt automatically; often several gigabytes.
~/.steam/steam/steamapps/NoRe-downloadable, and enormous.
/etcYesSystem configuration. Timeshift covers this.

Verify the backup

An unverified backup is a guess. Once a month, restore one file and open it:

# compare a folder against the backup, reporting differences only
diff -r ~/Documents /media/you/Backup/Documents | head

# or list an archive without extracting it
tar -tzf ~/dotfiles-2026-11-21.tar.gz | head

The three-copy rule

One working copy, one local backup on a different disk, one copy somewhere else — an external drive you keep at another address, or a cloud folder. Two of the three is most of the protection; all three is what survives a stolen laptop.